ReadyRemit Token Response
Authentication token response structure
Overview
The ReadyRemitTokenResponse interface defines the structure of a successful authentication token response. This response should be returned by your fetchAccessTokenDetails callback when the SDK requests authentication.
Definition
export interface ReadyRemitTokenResponse {
accessToken: string;
expiresIn: number;
scope: string;
tokenType: string;
}Properties
| Property | Type | Required | Description |
|---|---|---|---|
| accessToken | string | Yes | The OAuth 2.0 access token issued by the ReadyRemit API |
| expiresIn | number | Yes | The lifetime of the access token in seconds |
| scope | string | Yes | The scope of the access token (e.g., readyremit:write) |
| tokenType | string | Yes | The type of token issued (typically Bearer) |
Sample Usage
import type { ReadyRemitTokenResponse } from 'react-native-ready-remit-sdk';
const fetchAccessTokenDetails = async (): Promise<ReadyRemitTokenResponse> => {
const response = await fetch('https://your-api.com/oauth/token', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ /* your auth params */ }),
});
const data = await response.json();
return {
accessToken: data.access_token,
expiresIn: data.expires_in,
scope: data.scope,
tokenType: data.token_type,
};
};Example Response
{
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 3600,
"scope": "readyremit:write",
"tokenType": "Bearer"
}Related
- Fetch Access Token Details - Callback that returns this response
- ReadyRemitError - Error response structure when authentication fails
Updated 4 days ago
