(subscribers.credentials)
- update - Update subscriber credentials
- append - Modify subscriber credentials
- delete - Delete subscriber credentials by providerId
Subscriber credentials associated to the delivery methods such as slack and push tokens.
import { Novu } from "@novu/api";
const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await novu.subscribers.credentials.update({
providerId: "pushpad",
credentials: {
webhookUrl: "https://example.com/webhook",
},
}, "<id>");
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { NovuCore } from "@novu/api/core.js";
import { subscribersCredentialsUpdate } from "@novu/api/funcs/subscribersCredentialsUpdate.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 subscribersCredentialsUpdate(novu, {
providerId: "pushpad",
credentials: {
webhookUrl: "https://example.com/webhook",
},
}, "<id>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
subscriberId |
string | ✔️ | N/A |
updateSubscriberChannelRequestDto |
components.UpdateSubscriberChannelRequestDto | ✔️ | N/A |
idempotencyKey |
string | ➖ | A header for idempotency purposes |
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.SubscribersControllerUpdateSubscriberChannelResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorDto | 400, 404, 409 | application/json |
errors.ValidationErrorDto | 422 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Subscriber credentials associated to the delivery methods such as slack and push tokens.
This endpoint appends provided credentials and deviceTokens to the existing ones.
import { Novu } from "@novu/api";
const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await novu.subscribers.credentials.append({
providerId: "zulip",
credentials: {
webhookUrl: "https://example.com/webhook",
},
}, "<id>");
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { NovuCore } from "@novu/api/core.js";
import { subscribersCredentialsAppend } from "@novu/api/funcs/subscribersCredentialsAppend.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 subscribersCredentialsAppend(novu, {
providerId: "zulip",
credentials: {
webhookUrl: "https://example.com/webhook",
},
}, "<id>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
subscriberId |
string | ✔️ | N/A |
updateSubscriberChannelRequestDto |
components.UpdateSubscriberChannelRequestDto | ✔️ | N/A |
idempotencyKey |
string | ➖ | A header for idempotency purposes |
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.SubscribersControllerModifySubscriberChannelResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorDto | 400, 404, 409 | application/json |
errors.ValidationErrorDto | 422 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Delete subscriber credentials such as slack and expo tokens.
import { Novu } from "@novu/api";
const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await novu.subscribers.credentials.delete("<id>", "<id>");
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { NovuCore } from "@novu/api/core.js";
import { subscribersCredentialsDelete } from "@novu/api/funcs/subscribersCredentialsDelete.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 subscribersCredentialsDelete(novu, "<id>", "<id>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
subscriberId |
string | ✔️ | N/A |
providerId |
string | ✔️ | N/A |
idempotencyKey |
string | ➖ | A header for idempotency purposes |
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.SubscribersControllerDeleteSubscriberCredentialsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorDto | 400, 404, 409 | application/json |
errors.ValidationErrorDto | 422 | application/json |
errors.SDKError | 4XX, 5XX | */* |