Skip to main content

issueUserToken

@coinbase/waas-server-authAPI


Function: issueUserToken()

issueUserToken(options): Promise<string>

Issues an auth token scoped to a specified user. This will grant the user access to create their own wallets and addresses, as well as to fetch details about only wallets and addresses that they own.

This requires the configuration data from the full coinbase_api_key.json (a JSON file you downloaded at project-creation time) to sign the request to generate the token, as well as the user ID to scope the token for.

Parameters

options: IssueUserTokenOptions

See IssueUserTokenOptions

Returns

Promise<string>

An auth token for use with the WaasSdk.

Example

// Issuing a user token:
const token = await issueUserToken({
apiKeyName: "organizations/<organizationId>/apiKeys/<apiKeyId>",
privateKey: "<privateKey>",
userID: "<UUID of the user>"
});

Was this helpful?