Get Push Notification Instance
Note: Ensure you have installed the required package to use this SDK method.
You can get the pushNotification component reference as shown below. This will not fire a server-side call. You will refer to this component instance in various code snippets when working with the Push Notification component.
copy
const pushNotification = new PushNotification(); // Get push notification instance
Note:
- Passing an initialized app instance to a component determines the authentication scope it uses.
- To perform an operation with user-level permissions, initialize the SDK with User scope, or with custom credentials, and pass that instance to the component. This runs the operation in the user’s scope or custom credential scope instead of the default admin scope.
copy
const pushNotification = new PushNotification(app);
- If your Function or AppSail application needs both custom credentials and admin authentication at the same time, give each initialization a unique app name, otherwise the custom initialization can overwrite your existing admin credentials.
- In all cases, explicitly pass the matching app instance to each component so it uses the intended authentication scope; if none is provided, the SDK defaults to the admin credentials.
Last Updated 2026-09-09 16:15:38 +0530 IST
Yes
No
Send your feedback to us
Skip
Submit