Home > @cjh1/sfapi > Client > (constructor)
Constructs a new instance of the Client class
Signature:
constructor(clientID: string, redirectUrl: URL, authorizationUrl: URL, tokenUrl: URL, scopes: string[], apiBaseUrl: URL, onAccessTokenExpiry: (refreshAccessToken: () => Promise<AccessContext>) => Promise<AccessContext>, onInvalidGrant: (refreshAuthCodeOrRefreshToken: () => Promise<void>) => void);
| Parameter | Type | Description |
|---|---|---|
| clientID | string | The OIDC client id |
| redirectUrl | URL | The URI to redirect to after the interaction is complete |
| authorizationUrl | URL | The OIDC authorization URL |
| tokenUrl | URL | The OIDC token URL |
| scopes | string[] | The scopes to request |
| apiBaseUrl | URL | The base URL for the SF API instance |
| onAccessTokenExpiry | (refreshAccessToken: () => Promise<AccessContext>) => Promise<AccessContext> | Callback for token expiry |
| onInvalidGrant | (refreshAuthCodeOrRefreshToken: () => Promise<void>) => void | Callback for invalid grant |