Skip to content

Commit

Permalink
[PSDK-187] Server Signer Support (#42)
Browse files Browse the repository at this point in the history
* [PSDK-187] Server Signer Support

* tests

* use configuration option types for constructors

* typedocs

* nits

* readme

* pr review

* update docs

* update typedocs
  • Loading branch information
John-peterson-coinbase authored Jun 3, 2024
1 parent 7cb8c06 commit 048c586
Show file tree
Hide file tree
Showing 212 changed files with 4,257 additions and 1,160 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,20 @@ To start, [create a CDP API Key](https://portal.cdp.coinbase.com/access/api). Th
```typescript
const apiKeyName = "Copy your API Key name here.";

const apiKeyPrivateKey = "Copy your API Key's private key here.";
const privatekey = "Copy your API Key's private key here.";

const coinbase = new Coinbase(apiKeyName, apiKeyPrivateKey);
const coinbase = new Coinbase({ apiKeyName: apiKeyName, privateKey: privateKey });
```

If you are using a CDP Server-Signer to manage your private keys, enable it with the constuctor option:
```typescript
const coinbase = new Coinbase({ apiKeyName: apiKeyName, privateKey: apiKeyPrivateKey, useServerSigner: true })
```

Another way to initialize the SDK is by sourcing the API key from the json file that contains your API key, downloaded from CDP portal.

```typescript
const coinbase = Coinbase.configureFromJson("path/to/your/api-key.json");
const coinbase = Coinbase.configureFromJson({ filePath: "path/to/your/api-key.json" });
```

This will allow you to authenticate with the Platform APIs and get access to the default `User`.
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/navigation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

Loading

0 comments on commit 048c586

Please sign in to comment.