Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guide iconUser guide
Developer guide iconDeveloper guide
Admin guide iconAdmin guide
English
  • Русский
  • English
Login
    User documentationGetting StartedFAQAltcraft glossary
      Profiles and databasesarrow
    • Subscription resourcesManaging databasesSubscriber profileProfiles import and data updateScheduled customer data importAutomatic data collectionBulk customers profiles updateDouble opt-in subscriptionSuppression listsProfile relationsProfile history exportProfile exportCreating a static segment based on import resultsHow to open a CSV fileMatchingTypes of fields in the databaseGlobal control groupsSubscription Manager
      Communication channelsarrow
      • Email channelarrow
      • Email: ISP interactions best practicesEmail: sending domain configurationEmail: setting up and using postmastersБыстрый старт
        Push channelarrow
        • Mobile Pusharrow
        • Settings & implementation
            Integrate your app with Altcraftarrow
          • Providers: push message structureProcessing and adding a subscriptionEvent registration
          Web pusharrow
        • Preliminary Settings
            Web browser push configurationarrow
          • Firebase Cloud messagingApple SafariMozilla Services
          Connecting Web Push to a WebsiteTransferring Data to the PlatformWeb Push SDK Methods
            Import of subscriptions from third-party push servicesarrow
          • Migrating push subscriptions from third-party servicesHow to transfer push subscriptions configured for Safari?Migration from OneSignal
      SMS channel
        Creating mailing from scratcharrow
      • EmailSMSWeb PushMobile PushWhatsAppViber*™Руководство: SMS-рассылка через VK NotifyMAX BotMAX GroupNotifyTelegram BotTelegram Group
      Communication Channels WorkflowРуководство: SMS-рассылка через УТШРуководство: push-рассылка через сервис от "Согласие"
      Segmentationarrow
    • Static SegmentsDynamic SegmentsUpdatable Segments
        Segmentation Conditionsarrow
      • Segmentation by Profile dataSegmentation by Interactions with EntitiesSegmentation by Activity of the channelSegmentation by external dataSegmentation by external SQL tablesSegmentation by Profile structure
      Best Send Time (BST)Logical operators "AND" and "OR"Recommendations for working with segments
      Message templatesarrow
      • Working with message templatesarrow
      • Working in the editorEmail-templateSMS templatePush templateMAX templateTelegram templateWhatsApp templateViber™ templateNotify template
        Visual editor for email-templatearrow
      • Visual editor interfaceAdding blocksElements and their settingsCustom blocksStyle managerLayer manager
      Template fragmentsImage galleryContent personalizationCreating tables based on array elementsBlock editor for email template
        Altcraft Variables and Functionsarrow
      • Logical expressions in messagesLoops in messagesMarket variables in templatesUsing the JSONPath functionality
        Dynamic content in messagesarrow
      • Dynamic HTML contentDynamic JSON contentContent from SQL database in templatesDynamic API content
      Importing and exporting a message templateImporting a template from a third-party serviceExporting a template from Pixcraft
      Mailingsarrow
    • Mailings calendarBroadcast mailingsRegular mailingTrigger mailingMultivariate testingMailing testingMailing schedulePlacement mailing
      Campaignsarrow
    • Working with CampaignsLocal control groups (LCG)Stratification Violation ErrorAudience expansionAudience building
      Automation scenariosarrow
    • Managing scenariosNodes of the scenarioClassic marketing scenariosStep-by-step welcome scenario guideScenario for automatic notification of the managerAbandoned cart scenario
      Marketarrow
    • Market settings
        Productsarrow
      • How to create a product manuallyHow to import a product from a fileScheduled product importProduct and SKU SegmentsPreparing the YML file
      OrdersMarket variables in message templateGuide: how to send an order confirmation email
      Loyalty programsarrow
    • Loyalty programsLoyalty integration with external systemsБыстрый стартBasic loyalty program use casesOrder SegmentsPromotion codes
      Reports and analyticsarrow
    • Channel reportTraffic report
        Summary reportarrow
      • Summary report metrics
      Cohorts reportLifetime reportFunnels reportGoals reportAudience growth reportClick map reportLoyalty programs reportBounces reportUndeliveries reportReport on global control groups
      Integrationsarrow
      • Action hooksarrow
      • Altcraft Action HooksAction hooks event typesAction Hook Message StructureJSON batch request (HTTP POST action hook)Message to RabbitMQ brokerMessage to RabbitMQ exchangerMessage to Kafka brokerTest event
        Integration of third-party services using Albatoarrow
      • Connecting Altcraft to Albato Launching the welcome scenario using AlbatoTransmitting event dataSetting app a trigger mailingEvent registrationGoogle Sheets and Altcraft integration AmoCRM and Altcraft integration
      Facebook Ads Manager™Google Ads AudiencesMAXYandex.Audience™VK Ads™Static segment synchronizationYandex AppMetrica™Tilda™Lpgenerator™WhatsAppViber*™ integrationIntegration scopeData Transmitted During SynchronizationNotify
      Weblayersarrow
      • Formsarrow
      • Create a formForm constructorAppearanceActions after form activationData analyticsBinding data channel and formsConditional logic in forms and surveysNPS testing
        Pixelsarrow
      • Goal customer actions and scoring
        Pop-upsarrow
      • Creating and publishing a pop-upSetting up a popup in the code editorManaging pop-ups manually via scriptPopup analyticsGuide: pop-up for push subscriptionsCase: Creating a pop-up with the "Wheel of Fortune" widgetBasic cases of placing a popup via the Tag Manager
        Tag Managerarrow
      • Configuring and installing Tag ManagerTrigger typesVariables typesLinking a pixel and the Tag manager
      Settingsarrow
    • Account settingsCustom linksVirtual sendersSending policiesAudit journalTags FAQ
        Users, groups and accessarrow
      • Two-Factor Authentication (2FA)
        Connectionsarrow
      • Connection to Facebook Ads ManagerConnection to Google AdsConnecting to Yandex.Audience™Connection to 360dialogConnection to EdnaConnection to Devino TelecomConnection to SMSTrafficConnection to VK Ads™Connection to MTS OmniChannelCustom Authentication ConnectionOAuth2 connectionBasic Authentication connectionToken Authentication connectionConnection to RapportoMAX connectionConnection to Notify
      Attribute settings
      API requests: where to startarrow
    • Import or update a profileTrigger mailing launchEngage profile in scenario
      Changelogarrow
    • v2026.1.76v2025.4.75v2025.4.74v2025.3.73v2025.2.72v2025.1.71v2024.4.70v2024.3.69v2024.2.68.2v2024.1.68
    Documentation archivelibrary
  • Communication channels
  • Push channel
  • Web push
  • Web Push SDK Methods

Web Push SDK Methods

tip

For more details on setting up Web Push mailings on the platform and installing the SDK on your website, refer to this section.

This article describes the Web Push SDK methods and their possible parameters. Each method is also accompanied by a usage example.

initSubscription​

This method initializes a subscription. It is used to record client data in a profile and perform a search among existing profiles.

Parameters​

ParameterTypeRequiredDescription
matchobjectYesDefines profile matching. If no profile database is provided for the search, the platform will search within the databases linked to the resource.
updateobjectNoContains data to be added to a new or existing profile.

Usage Example​

const akPush = new AKPush();
akPush.initSubscription(
{
db: 1
email: 'example@email.com'
}, // Searching for a profile by email. If no match is found, it will be recorded in the profile.

{
_fname: 'Anatoly',
_lname: 'Wasserman'
} // Recording the subscriber's first and last name in the profile
)

updateSubscription​

This method updates profile data and modifies the status of push subscriptions.

Parameters​

ParameterTypeRequiredDescription
matchobjectYesDefines profile matching. If no profile database is provided for the search, the platform will search within the databases linked to the resource.
updateobjectNoContains data to be added to a new or existing profile. If you want to pass the inexclusive parameter without updating the profile data, you must specify an empty {} object in update.
inexclusivebooleanNoIf the inexclusive flag is not provided or set to false:

1. If no database filter is specified, each database of the resource will have only one profile with one subscription for the current token with the status "Subscribed".
2. If a filter is specified, each specified database will have only one profile with one subscription for the current token with the "Subscribed" status. In other databases, all matching subscriptions to the resource for all profiles will be suspended.

If the inexclusive flag is set to true, the call is equivalent to AKPush.initSubscription, meaning the profile data will be updated and the subscription status changed to "Subscribed".

Usage Example​

const akPush = new AKPush();
akPush.updateSubscription(
{
db: [15,20]
email: 'example@email.com'
},

{
_fname: 'Anatoly',
_lname: 'Wasserman'
}, // Recording the subscriber's first and last name in the profile
false // Whether to suspend all subscriptions to the resource with the current browser token for other profiles (default)
)

AKPush.events.on​

This method subscribes to events related to push notifications.

Parameters​

ParameterTypeRequiredDescription
subscribe
update_subscription
suspend_subscription
stringYesName of the triggered event.
callbackfunctionYes

Function that will be called when the event occurs. For subscribe, the returned parameters will be:

{
browser: "<subscriber's browser>"​
provider: "<push provider>"​
token: "<subscriber's token>"
}


For update_subscription and suspend_subscription, the returned parameters will be:

{
browser: "<subscriber's browser>"​
provider: "<push provider>"​
token: "<subscriber's token>"
tokenCached: "<cached subscriber's token>"
}

Usage Example​

AKPush.events.on('subscribe', (data) => { // Subscribe to the subscribe event
console.log(data);
});
AKPush.events.on('update_subscription', (data) => { // Subscribe to the update_subscription event
console.log(data);
});

suspendSubscription​

This method suspends a user's push notification subscription. The subscription can be resumed using the same method.

Parameters​

ParameterTypeRequiredDescription
matchobjectYesDefines profile matching. If no profile database is provided for the search, the platform will search within the databases linked to the resource.
updateobjectNoContains data to be added to a new or existing profile.

Usage Example​

AKPush.suspendSubscription(
{
db: 1
email: 'example@email.com'
},
{
_status: 'inactive'
} // Updating the subscriber's profile status
)

AKPush.removeToken​

This method removes a device token from the cache. It is used, for example, when a user changes on the device. No parameters are required for this method.

Usage Example​

AKPush.removeToken()
Last updated on Mar 12, 2026
Previous
Transferring Data to the Platform
Next
Import of subscriptions from third-party push services
  • initSubscription
    • Parameters
    • Usage Example
  • updateSubscription
    • Parameters
    • Usage Example
  • AKPush.events.on
    • Parameters
    • Usage Example
  • suspendSubscription
    • Parameters
    • Usage Example
  • AKPush.removeToken
    • Usage Example
© 2015 - 2026 Altcraft, LLC. All rights reserved.