import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const response = await client.hooks.subscribe({ targetUrl: 'https://example.com' });
console.log(response.id);{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscribed": true,
"url": "<string>",
"events": [
"<string>"
],
"service": "<string>"
}Subscribe the current user to a webhook URL. Returns subscription id.
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const response = await client.hooks.subscribe({ targetUrl: 'https://example.com' });
console.log(response.id);{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscribed": true,
"url": "<string>",
"events": [
"<string>"
],
"service": "<string>"
}Bearer token via Authorization header
Request model for subscribing to webhooks.
Successful Response
Was this page helpful?