Braze JavaScript SDK
    Preparing search index...

    Function openSession

    • Opens a new session, or resumes the previous session if this device had activity within the sessionTimeoutInSeconds value.

      Call openSession at the end of your initialization code section, after any calls to changeUser or setIdentifierToken. Calling openSession before either function may result in the creation of duplicate anonymous users and multiple sessions.

      Returns Promise<boolean | undefined>

      Resolves to a boolean that indicates whether a new session was started. Resolves to undefined if the SDK has not been initialized.