Compare OneSignal Web SDK methods between the legacy Player Model and the new User Model. Learn how to migrate your implementation with TypeScript-based code examples and updated method references.
This document maps the methods, properties, and events from OneSignal’s legacy Player Model Web SDK to the newer User Model SDK. Each section includes matching TypeScript code examples, clearly demonstrating how to update your integration.
All examples are simplified for demonstration purposes. For complete and up-to-date implementations, refer to the documentation links provided under each method or event.
Update the import in your OneSignalSDKWorker.js
file:
Player Model:
User Model:
Keep the file path the same. Just update the importScripts
URL.
See OneSignal Service Worker for more information.
init()
Player Model: Docs
User Model: Docs
provideUserConsent()
Player Model: Docs
User Model: Docs
showNativePrompt()
Player Model:
User Model: Docs
registerForPushNotifications()
— Dropped in User Model#permissionPromptDisplay
Player Model:
User Model: Docs
showSlidedownPrompt()
Player Model:
User Model: Docs
showHttpPrompt()
— Dropped in User ModelshowCategorySlidedown()
Player Model:
User Model: Docs
#getNotificationPermission
Player Model:
User Model: Docs
isPushNotificationsSupported()
Player Model:
User Model: Docs
isPushNotificationsEnabled()
Player Model:
User Model: Docs
#subscriptionChange
Player Model:
User Model:
#notificationPermissionChange
Player Model:
User Model: Docs
#popoverShown
Player Model:
User Model: Docs
#customPromptClick
Player Model:
User Model: Docs
getUserId()
Player Model:
User Model: Docs
setExternalUserId()
Player Model: Docs
User Model: Docs
removeExternalUserId()
Player Model:
User Model: Docs
getExternalUserId()
Player Model:
User Model: Docs
sendTag()
Player Model:
User Model:
User Model doc
sendTags()
Player Model:
User Model:
getTags()
Player Model:
User Model:
deleteTag()
Player Model:
User Model:
deleteTags()
Player Model:
User Model:
sendSelfNotification()
— Dropped in User ModelsetSubscription()
Player Model:
User Model:
#notificationDisplay
Player Model:
User Model:
#notificationDismiss
Player Model:
User Model:
#addListenerForNotificationOpened
Player Model:
User Model:
setEmail()
User Model doc
Player Model:
User Model:
logoutEmail()
Player Model:
User Model:
getEmailId()
— Dropped in User ModelsetSMSNumber()
Player Model:
User Model:
logoutSMSNumber()
Player Model:
User Model:
Compare OneSignal Web SDK methods between the legacy Player Model and the new User Model. Learn how to migrate your implementation with TypeScript-based code examples and updated method references.
This document maps the methods, properties, and events from OneSignal’s legacy Player Model Web SDK to the newer User Model SDK. Each section includes matching TypeScript code examples, clearly demonstrating how to update your integration.
All examples are simplified for demonstration purposes. For complete and up-to-date implementations, refer to the documentation links provided under each method or event.
Update the import in your OneSignalSDKWorker.js
file:
Player Model:
User Model:
Keep the file path the same. Just update the importScripts
URL.
See OneSignal Service Worker for more information.
init()
Player Model: Docs
User Model: Docs
provideUserConsent()
Player Model: Docs
User Model: Docs
showNativePrompt()
Player Model:
User Model: Docs
registerForPushNotifications()
— Dropped in User Model#permissionPromptDisplay
Player Model:
User Model: Docs
showSlidedownPrompt()
Player Model:
User Model: Docs
showHttpPrompt()
— Dropped in User ModelshowCategorySlidedown()
Player Model:
User Model: Docs
#getNotificationPermission
Player Model:
User Model: Docs
isPushNotificationsSupported()
Player Model:
User Model: Docs
isPushNotificationsEnabled()
Player Model:
User Model: Docs
#subscriptionChange
Player Model:
User Model:
#notificationPermissionChange
Player Model:
User Model: Docs
#popoverShown
Player Model:
User Model: Docs
#customPromptClick
Player Model:
User Model: Docs
getUserId()
Player Model:
User Model: Docs
setExternalUserId()
Player Model: Docs
User Model: Docs
removeExternalUserId()
Player Model:
User Model: Docs
getExternalUserId()
Player Model:
User Model: Docs
sendTag()
Player Model:
User Model:
User Model doc
sendTags()
Player Model:
User Model:
getTags()
Player Model:
User Model:
deleteTag()
Player Model:
User Model:
deleteTags()
Player Model:
User Model:
sendSelfNotification()
— Dropped in User ModelsetSubscription()
Player Model:
User Model:
#notificationDisplay
Player Model:
User Model:
#notificationDismiss
Player Model:
User Model:
#addListenerForNotificationOpened
Player Model:
User Model:
setEmail()
User Model doc
Player Model:
User Model:
logoutEmail()
Player Model:
User Model:
getEmailId()
— Dropped in User ModelsetSMSNumber()
Player Model:
User Model:
logoutSMSNumber()
Player Model:
User Model: