Skip to content

Make createAuthenticatedClient's privateKey input type clear #5

@sidvishnoi

Description

@sidvishnoi

In open-payments package README and in lack of JSDoc comments, it's not clear what goes in privateKey parameter of createAuthenticatedClient function.

So far, I've seen people writing:

  • path to key (passes, as expected)
  • a string in -----BEGIN PRIVATE KEY format (fails)
  • a base64 encoded string (fails)
  • Buffer.from(base64PrivateKeyString, 'base64') (passes)

If we can write more examples (in README as well as JSDoc) and/or restrict TypeScript types, that would be very helpful. Throwing any errors earlier would be helpful too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions