GitHub

RDK

Authentication

You can generate custom tokens via RDK.

  • You cannot generate more than 10 custom tokens in parallel.
interface GenerateCustomToken {
    userId: string
    identity: string
    claims?: KeyValue
}


interface GenerateCustomTokenResponse {
    success: boolean
    data?: {
        customToken: string
    }
    error?: string
}


async function generateCustomToken(input: GenerateCustomToken): Promise<GenerateCustomTokenResponse | undefined> {
    // ...
}

Usage

import RDK from '@retter/rdk'


const rdk = new RDK()


await rdk.generateCustomToken({ userId: 'user00', identity: 'enduser', claims: { name: 'John Doe' } })


await rdk.pipeline()
    .generateCustomToken({ userId: 'user01', identity: 'enduser', claims: { name: 'John Doe' } })
    .generateCustomToken({ userId: 'user02', identity: 'enduser', claims: { name: 'Jane Doe' } })
    .send()

API Reference

Generate Custom Token Input

ParameterTypeRequiredDescription
userIdstringtrueUser's ID to put into the token
identitystringtrueUser's identity (role) to put into the token
claimsRecord<string, any>falseUser's metadata to put into the token

Generate Custom Token Output

ParameterTypeRequiredDescription
successbooleantrueReturns true if operation is successful
data{ customToken: string }falseSuccessful response
errorstringfalseReason of failure
Previous
Operations