Skip to main content
OneSignal has updated from a device-centric model (Player ID) to a user-centric model (OneSignal ID). For migration guidance, refer to the User Model Migration Guide.For documentation on legacy device-centric implementations, see Version 9.

Overview

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.

OneSignal Service Worker

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.

Initialization

init()

Player Model: Docs
User Model: Docs

provideUserConsent()

Player Model: Docs
User Model: Docs

Registering for push

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 Model

showCategorySlidedown()

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:

Analytics

#notificationPermissionChange

Player Model:
User Model: Docs

#popoverShown

Player Model:
User Model: Docs

#customPromptClick

Player Model:
User Model: Docs

User IDs

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

Tags

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:

Push Notifications

sendSelfNotification() — Dropped in User Model

setSubscription()

Player Model:
User Model:

Receiving Notifications

#notificationDisplay

Player Model:
User Model:

#notificationDismiss

Player Model:
User Model:

#addListenerForNotificationOpened

Player Model:

Email

setEmail()

User Model doc Player Model:
User Model:

logoutEmail()

Player Model:
User Model:

getEmailId() — Dropped in User Model

SMS

setSMSNumber()

Player Model:
User Model:

logoutSMSNumber()

Player Model:
User Model: