Skip to main content

RealtimeStoreCreateOptions

Class

The options for the realtime store.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Index

Example

// @input Asset.ConnectedLensModule connectedLensModule

var options = ConnectedLensSessionOptions.create();
script.connectedLensModule.createSession(options)

var initialStore = GeneralDataStore.create();
initialStore.putInt('state', 1);

var options = RealtimeStoreCreateOptions.create();
options.ownership = RealtimeStoreCreateOptions.Ownership.Unowned;
options.persistence = RealtimeStoreCreateOptions.Persistence.Session;
options.initialStore = initialStore;

session.createRealtimeStore(options,
function onSuccess(store) {
print('Store created! In On connected');

},
function onError(message) {
print('Unable to create a store: ' + message)
}
)

Extends

Properties

allowOwnershipTakeOver

allowOwnershipTakeOver: boolean

Since

Lens Scripting Version 184

Default Value

false

initialStore

initialStore: GeneralDataStore

An existing store to be used as the initial values for the real time store.

Since

Lens Scripting Version 173

Default Value

null

ownership

ownership: Ownership

The ownership model for the realtime store.

Since

Lens Scripting Version 173

Default Value

RealtimeStoreCreateOptions.Ownership.Owned

persistence

persistence: Persistence

The persistence model for the realtime store.

Since

Lens Scripting Version 173

Default Value

RealtimeStoreCreateOptions.Persistence.Ephemeral

storeId

storeId: string

Writes an id string to the store that can be used to identify it later.

Since

Lens Scripting Version 181

Default Value

""

Methods

create()

static create(): RealtimeStoreCreateOptions

Creates the realtime store options object.

Returns

RealtimeStoreCreateOptions

Since

Lens Scripting Version 173


getTypeName()

static getTypeName(): TypeName<RealtimeStoreCreateOptions>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<RealtimeStoreCreateOptions>

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame

Nested types

Enumerations

EnumerationDescription
OwnershipThe ownership model of a realtime store.
PersistenceThe persistence model for a realtime store.