(subscribers.authentication)
- chatAccessOauthCallBack - Handle providers oauth redirect
- chatAccessOauth - Handle chat oauth
Handle providers oauth redirect
import { Novu } from "@novu/api";
const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await novu.subscribers.authentication.chatAccessOauthCallBack({
subscriberId: "<id>",
providerId: "<id>",
hmacHash: "<value>",
environmentId: "<id>",
code: "<value>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { NovuCore } from "@novu/api/core.js";
import { subscribersAuthenticationChatAccessOauthCallBack } from "@novu/api/funcs/subscribersAuthenticationChatAccessOauthCallBack.js";
// Use `NovuCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const novu = new NovuCore({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await subscribersAuthenticationChatAccessOauthCallBack(novu, {
subscriberId: "<id>",
providerId: "<id>",
hmacHash: "<value>",
environmentId: "<id>",
code: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.SubscribersControllerChatOauthCallbackRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.SubscribersControllerChatOauthCallbackResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorDto | 400, 404, 409 | application/json |
errors.ValidationErrorDto | 422 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Handle chat oauth
import { Novu } from "@novu/api";
const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await novu.subscribers.authentication.chatAccessOauth({
subscriberId: "<id>",
providerId: "<id>",
hmacHash: "<value>",
environmentId: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { NovuCore } from "@novu/api/core.js";
import { subscribersAuthenticationChatAccessOauth } from "@novu/api/funcs/subscribersAuthenticationChatAccessOauth.js";
// Use `NovuCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const novu = new NovuCore({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await subscribersAuthenticationChatAccessOauth(novu, {
subscriberId: "<id>",
providerId: "<id>",
hmacHash: "<value>",
environmentId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.SubscribersControllerChatAccessOauthRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.SubscribersControllerChatAccessOauthResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorDto | 400, 404, 409 | application/json |
errors.ValidationErrorDto | 422 | application/json |
errors.SDKError | 4XX, 5XX | */* |