default
const default: { isMobileLocker: () => boolean; isApp: () => boolean; isCDN: () => boolean; isIOS: () => boolean; isAndroid: () => boolean; isWindows: () => boolean; isElectron: () => boolean; MobileLockerError: typeof MobileLockerError; notificationLevels: { NOTIFY_NONE: number; NOTIFY_FIRST: number; NOTIFY_EVERY: number; NOTIFY_WEEKLY: number; NOTIFY_MONTHLY: number; }; analytics: { logEvent: void; }; congresses: { list: Promise<Event[]>; get: Promise<Event>; getAttendees: Promise<Attendee[]>; getAttendee: Promise<Attendee>; getBusinessCards: Promise<BusinessCard[]>; getBusinessCard: Promise<BusinessCard>; }; contacts: { get: Promise<UserContact>; getPage: Promise<Page<UserContact>>; eachPage: Promise<void>; }; crm: { getAccountsPage: Promise<Page<CRMAccount>>; eachAccountsPage: Promise<void>; getAccount: Promise<CRMAccount>; getAddressesPage: Promise<Page<CRMAddress>>; eachAddressesPage: Promise<void>; getAddress: Promise<CRMAddress>; getContactsPage: Promise<Page<CRMContact>>; eachContactsPage: Promise<void>; getContact: Promise<CRMContact>; getLeadsPage: Promise<Page<CRMLead>>; eachLeadsPage: Promise<void>; getLead: Promise<CRMLead>; getUsersPage: Promise<Page<CRMUser>>; eachUsersPage: Promise<void>; getUser: Promise<CRMUser>; openCustomerPicker: Promise<PickerResult>; getCurrentCustomers: Promise<Customer[]>; getRecentCustomers: Promise<Customer[]>; isCurrentCustomer: Promise<boolean>; setCurrentCustomers: Promise<void>; addCurrentCustomer: Promise<void>; removeCurrentCustomer: Promise<void>; clearCurrentCustomers: Promise<void>; refresh: Promise<CRMRefreshResult>; query: Promise<CRMQueryResult>; }; data: { submitForm: void; getProducts: Promise<Product[]>; getProduct: Promise<Product>; getLabels: Promise<Label[]>; getLabel: Promise<Label>; getFolders: Promise<Folder[]>; getFolder: Promise<Folder>; getCustomers: Promise<Customer[]>; getCustomer: Promise<Customer>; }; database: { list: Promise<string[]>; describe: Promise<DatabaseTableDescription>; query: Promise<DatabaseQueryResult>; }; log: { setMode: void; isEnabled: boolean; liveMode: void; practiceMode: void; getSdkLogs: Promise<SDKLogEntry[]>; searchSdkLogs: Promise<SDKLogEntry[]>; debug: void; info: void; warn: void; error: void; }; device: { get: Promise<DeviceInfo | null>; isAtLeastVersion: Promise<boolean>; }; http: { get: Promise<HTTPResponse>; post: Promise<HTTPResponse>; put: Promise<HTTPResponse>; patch: Promise<HTTPResponse>; delete: Promise<HTTPResponse>; request: (url, options) => Promise<HTTPResponse>; }; network: { getStatus: Promise<NetworkStatus>; }; permissions: { camera: Promise<PermissionResult>; microphone: Promise<PermissionResult>; photoLibrary: Promise<PermissionResult>; location: Promise<PermissionResult>; bluetooth: Promise<PermissionResult>; biometric: Promise<BiometricResult>; }; presentation: { get: Promise<Presentation>; getEvents: Promise<unknown[]>; getDeviceEvents: Promise<unknown[]>; reload: void; close: void; getAll: Promise<Presentation[]>; getByID: Promise<Presentation>; getByName: Promise<Presentation>; refresh: Promise<Presentation[]>; download: Promise<DownloadResult>; openByID: void; openByExternalID: Promise<void>; openByName: Promise<void>; openPicker: void; }; scanner: { scanBusinessCard: Promise<ScanResult>; scanBadge: Promise<ScanResult>; }; search: { query: Promise<SearchResults>; }; session: { getDeviceEvents: Promise<unknown[]>; get hitSessionId(): string | null; }; share: { presentation: void; email: void; }; localforage: MobileLockerLocalForage; storage: { get: Promise<StorageEntry | null>; getAll: Promise<StorageEntry[]>; getAllAcrossPresentations: Promise<StorageEntry[]>; getForPresentation: Promise<StorageEntry[]>; query: Promise<StorageEntry[]>; search: Promise<StorageEntry[]>; save: Promise<StorageEntry>; delete: Promise<void>; }; ui: { openPDF: void; showToolbar: void; openVideo: Promise<VideoResult>; }; user: { get: Promise<User>; };};Defined in: index.ts:33
Type Declaration
Section titled “Type Declaration”Analytics
Section titled “Analytics”analytics
Section titled “analytics”analytics: { logEvent: void;};analytics.logEvent()
Section titled “analytics.logEvent()”logEvent( category, action, uri, data?, method?): void;Track a custom analytics event.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
category |
string |
undefined |
Event category (e.g. 'data-capture', 'share'). |
action |
string |
undefined |
Event action (e.g. 'submit', 'open'). |
uri |
string |
undefined |
The URI or name that identifies the subject of the event. |
data? |
unknown |
undefined |
Optional payload attached to the event. |
method? |
string |
DEFAULT_METHOD |
Internal tracking method; defaults to 'trackevent'. |
Returns
Section titled “Returns”void
Example
Section titled “Example”mobilelocker.analytics.logEvent('product', 'view', '/slides/overview', { productId: 42 })log: { setMode: void; isEnabled: boolean; liveMode: void; practiceMode: void; getSdkLogs: Promise<SDKLogEntry[]>; searchSdkLogs: Promise<SDKLogEntry[]>; debug: void; info: void; warn: void; error: void;};log.setMode()
Section titled “log.setMode()”setMode(enabled): void;Enable or disable debug mode.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
enabled |
boolean |
Pass true to enable, false to disable. |
Returns
Section titled “Returns”void
log.isEnabled()
Section titled “log.isEnabled()”isEnabled(): boolean;Check whether debug mode is currently enabled.
Returns
Section titled “Returns”boolean
true if debug mode is on.
log.liveMode()
Section titled “log.liveMode()”liveMode(uri?): void;Mark the current session as a live (non-practice) presentation.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
uri |
string |
'' |
Optional URI or identifier to associate with the event. |
Returns
Section titled “Returns”void
log.practiceMode()
Section titled “log.practiceMode()”practiceMode(uri?): void;Mark the current session as a practice presentation.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
uri |
string |
'' |
Optional URI or identifier to associate with the event. |
Returns
Section titled “Returns”void
log.getSdkLogs()
Section titled “log.getSdkLogs()”getSdkLogs(filter?): Promise<SDKLogEntry[]>;Retrieve structured SDK log entries with optional filtering.
In the iOS app, fetches from the server-side GRDB table scoped to the current team, user, presentation, and device session. Outside the app, reads from IndexedDB via localforage (same entry shape, up to 1,000 entries).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
filter? |
SDKLogFilter |
Optional filter by level, domain, function, date range, retries, and limit. |
Returns
Section titled “Returns”Promise<SDKLogEntry[]>
Array of SDKLogEntry objects, newest first.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
Example
Section titled “Example”const errors = await mobilelocker.log.getSdkLogs({ level: 'error', domain: 'crm' })log.searchSdkLogs()
Section titled “log.searchSdkLogs()”searchSdkLogs(text, filter?): Promise<SDKLogEntry[]>;Full-text search across SDK log entries.
Searches the message field and stringified metadata. Accepts the same
filter options as getSdkLogs to narrow the scope before searching.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
text |
string |
The search string. |
filter? |
SDKLogFilter |
Optional pre-filter applied before the text search. |
Returns
Section titled “Returns”Promise<SDKLogEntry[]>
Array of matching SDKLogEntry objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
log.debug()
Section titled “log.debug()”debug(message, metadata?): void;Write a debug-level log entry into the SDK log store.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
message |
string |
Human-readable description of the event. |
metadata? |
Record<string, unknown> |
Optional key/value data to attach to the entry. |
Returns
Section titled “Returns”void
log.info()
Section titled “log.info()”info(message, metadata?): void;Write an info-level log entry into the SDK log store.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
message |
string |
Human-readable description of the event. |
metadata? |
Record<string, unknown> |
Optional key/value data to attach to the entry. |
Returns
Section titled “Returns”void
Example
Section titled “Example”mobilelocker.log.info('User selected product', { productId: 42, slide: 'overview' })log.warn()
Section titled “log.warn()”warn(message, metadata?): void;Write a warn-level log entry into the SDK log store.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
message |
string |
Human-readable description of the event. |
metadata? |
Record<string, unknown> |
Optional key/value data to attach to the entry. |
Returns
Section titled “Returns”void
log.error()
Section titled “log.error()”error(message, metadata?): void;Write an error-level log entry into the SDK log store.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
message |
string |
Human-readable description of the event. |
metadata? |
Record<string, unknown> |
Optional key/value data to attach to the entry. |
Returns
Section titled “Returns”void
session
Section titled “session”session: { getDeviceEvents: Promise<unknown[]>; get hitSessionId(): string | null;};session.getDeviceEvents()
Section titled “session.getDeviceEvents()”getDeviceEvents(): Promise<unknown[]>;Get all analytics events recorded during the current device session.
In the iOS app, fetches events from the server scoped to the current session. Outside the app (local development), returns events buffered in IndexedDB via localforage.
Returns
Section titled “Returns”Promise<unknown[]>
Array of raw event objects.
session.hitSessionId
Section titled “session.hitSessionId”Get Signature
Section titled “Get Signature”get hitSessionId(): string | null;Defined in: domains/session.ts:26
The session id created from the JWT’s hit_uuid when the presentation was opened
via a shared link on the CDN, or null if not applicable or not yet created.
Returns
Section titled “Returns”string | null
user: { get: Promise<User>;};user.get()
Section titled “user.get()”get(): Promise<User>;Get the currently authenticated user.
Returns
Section titled “Returns”Promise<User>
The authenticated User.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
Example
Section titled “Example”const u = await mobilelocker.user.get()console.log(`Hello, ${u.name}`)congresses
Section titled “congresses”congresses: { list: Promise<Event[]>; get: Promise<Event>; getAttendees: Promise<Attendee[]>; getAttendee: Promise<Attendee>; getBusinessCards: Promise<BusinessCard[]>; getBusinessCard: Promise<BusinessCard>;};congresses.list()
Section titled “congresses.list()”list(): Promise<Event[]>;List all lead retrieval events available to the current user.
Returns
Section titled “Returns”Promise<Event[]>
Array of Event objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
congresses.get()
Section titled “congresses.get()”get(eventID): Promise<Event>;Get a single lead retrieval event by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
eventID |
number |
The numeric ID of the event. |
Returns
Section titled “Returns”Promise<Event>
The matching Event.
Throws
Section titled “Throws”MobileLockerError on network failure or if the event is not found.
congresses.getAttendees()
Section titled “congresses.getAttendees()”getAttendees(eventID): Promise<Attendee[]>;Get all attendees for a lead retrieval event.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
eventID |
number |
The numeric ID of the event. |
Returns
Section titled “Returns”Promise<Attendee[]>
Array of Attendee objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
congresses.getAttendee()
Section titled “congresses.getAttendee()”getAttendee(attendeeID): Promise<Attendee>;Get a specific attendee by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
attendeeID |
string |
The attendee’s string ID. |
Returns
Section titled “Returns”Promise<Attendee>
The matching Attendee.
Throws
Section titled “Throws”MobileLockerError on network failure or if not found.
congresses.getBusinessCards()
Section titled “congresses.getBusinessCards()”getBusinessCards(): Promise<BusinessCard[]>;Get all business cards scanned by the current user.
Returns
Section titled “Returns”Promise<BusinessCard[]>
Array of BusinessCard objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
congresses.getBusinessCard()
Section titled “congresses.getBusinessCard()”getBusinessCard(cardID): Promise<BusinessCard>;Get a specific business card by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
cardID |
string |
The business card’s string ID. |
Returns
Section titled “Returns”Promise<BusinessCard>
The matching BusinessCard.
Throws
Section titled “Throws”MobileLockerError on network failure or if not found.
contacts
Section titled “contacts”contacts: { get: Promise<UserContact>; getPage: Promise<Page<UserContact>>; eachPage: Promise<void>;};contacts.get()
Section titled “contacts.get()”get(contactID): Promise<UserContact>;Get a specific contact by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
contactID |
number |
The ID of the contact to fetch. |
Returns
Section titled “Returns”Promise<UserContact>
A UserContact object.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
contacts.getPage()
Section titled “contacts.getPage()”getPage(limit, cursor?): Promise<Page<UserContact>>;Get one page of contacts (cursor envelope).
Requires Mobile Locker iOS 5.5.0+. Prefer contacts.eachPage when walking the whole book. Production users can have 100k+ contacts (MLJS-24 / MLJS-27); do not reassemble every page into one array.
Host: GET /mobilelocker/api/user-contacts?limit=&cursor=
→ { data, meta: { cursor: { next, count } } } (MLI-1718).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
limit |
number |
Page size (1…5000). |
cursor? |
string |
From previous meta.cursor.next. Omit for the first page. |
Returns
Section titled “Returns”Promise<Page<UserContact>>
Page of UserContact records.
Throws
Section titled “Throws”MobileLockerError with code InvalidArgument when limit is out of range.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
Example
Section titled “Example”const page = await mobilelocker.contacts.getPage(500)const next = page.meta.cursor.next ? await mobilelocker.contacts.getPage(500, page.meta.cursor.next) : nullcontacts.eachPage()
Section titled “contacts.eachPage()”eachPage(pageSize, handler): Promise<void>;Walk the address book page by page without loading everything into memory.
Replaces the removed getAll() (MLJS-24) and intermediate getChunked(min, limit)
(MLJS-27). Advances only via meta.cursor.next; stops when next === null.
Process each chunk in handler. Do not push chunks into a growing array
unless the book is known to be small. Requires iOS 5.5.0+.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pageSize |
number |
Page size passed to contacts.getPage (1…5000). |
handler |
(chunk) => void | Promise<void> |
Called once per non-empty page; may be async. |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”MobileLockerError when pageSize is out of range, or on network/server error.
Example
Section titled “Example”await mobilelocker.contacts.eachPage(500, (chunk) => { for (const contact of chunk) { // handle one contact — never accumulate the full book }})crm: { getAccountsPage: Promise<Page<CRMAccount>>; eachAccountsPage: Promise<void>; getAccount: Promise<CRMAccount>; getAddressesPage: Promise<Page<CRMAddress>>; eachAddressesPage: Promise<void>; getAddress: Promise<CRMAddress>; getContactsPage: Promise<Page<CRMContact>>; eachContactsPage: Promise<void>; getContact: Promise<CRMContact>; getLeadsPage: Promise<Page<CRMLead>>; eachLeadsPage: Promise<void>; getLead: Promise<CRMLead>; getUsersPage: Promise<Page<CRMUser>>; eachUsersPage: Promise<void>; getUser: Promise<CRMUser>; openCustomerPicker: Promise<PickerResult>; getCurrentCustomers: Promise<Customer[]>; getRecentCustomers: Promise<Customer[]>; isCurrentCustomer: Promise<boolean>; setCurrentCustomers: Promise<void>; addCurrentCustomer: Promise<void>; removeCurrentCustomer: Promise<void>; clearCurrentCustomers: Promise<void>; refresh: Promise<CRMRefreshResult>; query: Promise<CRMQueryResult>;};crm.getAccountsPage()
Section titled “crm.getAccountsPage()”getAccountsPage(limit, cursor?): Promise<Page<CRMAccount>>;Get one page of CRM accounts (cursor envelope).
Requires Mobile Locker iOS 5.5.0+. Prefer crm.eachAccountsPage when walking the full set, or filter with crm.query (SOQL) when possible. Do not reassemble every page into one array for large tables (MLJS-26).
Host: GET /mobilelocker/api/crm/accounts?limit=&cursor=
→ { data, meta: { cursor: { next, count } } } (MLI-1718).
Same envelope for addresses, contacts, leads, and users.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
limit |
number |
Page size (1…5000). |
cursor? |
string |
From previous meta.cursor.next. Omit for the first page. |
Returns
Section titled “Returns”Promise<Page<CRMAccount>>
Page of CRMAccount records.
Throws
Section titled “Throws”MobileLockerError with code InvalidArgument when limit is out of range.
Throws
Section titled “Throws”MobileLockerCRMError on network failure, auth expiry, or server error.
crm.eachAccountsPage()
Section titled “crm.eachAccountsPage()”eachAccountsPage(pageSize, handler): Promise<void>;Walk CRM accounts page by page without loading the full table into memory.
Replaces the removed getAccounts() (MLJS-26). Advances only via
meta.cursor.next; stops when next === null. Prefer crm.query
for filtered access. Do not push chunks into a growing array unless
the set is known to be small. Requires iOS 5.5.0+.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pageSize |
number |
Page size passed to crm.getAccountsPage (1…5000). |
handler |
(chunk) => void | Promise<void> |
Called once per non-empty page; may be async. |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”MobileLockerError when pageSize is out of range.
Throws
Section titled “Throws”MobileLockerCRMError on network/server error.
Example
Section titled “Example”await mobilelocker.crm.eachAccountsPage(500, (chunk) => { for (const account of chunk) { // handle one account — never accumulate the full table }})crm.getAccount()
Section titled “crm.getAccount()”getAccount(accountID): Promise<CRMAccount>;Get a specific CRM account by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
accountID |
string |
The CRM account ID to fetch. |
Returns
Section titled “Returns”Promise<CRMAccount>
CRM account record.
Throws
Section titled “Throws”MobileLockerCRMError on network failure, auth expiry, or server error.
crm.getAddressesPage()
Section titled “crm.getAddressesPage()”getAddressesPage(limit, cursor?): Promise<Page<CRMAddress>>;Get one page of CRM addresses. Same cursor envelope as crm.getAccountsPage (iOS 5.5.0+, limit 1…5000). Prefer crm.eachAddressesPage or crm.query.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
limit |
number |
cursor? |
string |
Returns
Section titled “Returns”Promise<Page<CRMAddress>>
crm.eachAddressesPage()
Section titled “crm.eachAddressesPage()”eachAddressesPage(pageSize, handler): Promise<void>;Walk CRM addresses page by page (meta.cursor.next only). Replaces removed getAddresses().
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
pageSize |
number |
handler |
(chunk) => void | Promise<void> |
Returns
Section titled “Returns”Promise<void>
crm.getAddress()
Section titled “crm.getAddress()”getAddress(addressID): Promise<CRMAddress>;Get a specific CRM address by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
addressID |
string |
The CRM address ID to fetch. |
Returns
Section titled “Returns”Promise<CRMAddress>
CRM address record.
Throws
Section titled “Throws”MobileLockerCRMError on network failure, auth expiry, or server error.
crm.getContactsPage()
Section titled “crm.getContactsPage()”getContactsPage(limit, cursor?): Promise<Page<CRMContact>>;Get one page of CRM contacts. Same cursor envelope as crm.getAccountsPage (iOS 5.5.0+, limit 1…5000). Prefer crm.eachContactsPage or crm.query.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
limit |
number |
cursor? |
string |
Returns
Section titled “Returns”Promise<Page<CRMContact>>
crm.eachContactsPage()
Section titled “crm.eachContactsPage()”eachContactsPage(pageSize, handler): Promise<void>;Walk CRM contacts page by page (meta.cursor.next only). Replaces removed getContacts().
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
pageSize |
number |
handler |
(chunk) => void | Promise<void> |
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”await mobilelocker.crm.eachContactsPage(500, (chunk) => { for (const contact of chunk) { // handle one contact }})crm.getContact()
Section titled “crm.getContact()”getContact(contactID): Promise<CRMContact>;Get a specific CRM contact by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
contactID |
string |
The CRM contact ID to fetch. |
Returns
Section titled “Returns”Promise<CRMContact>
CRM contact record.
Throws
Section titled “Throws”MobileLockerCRMError on network failure, auth expiry, or server error.
crm.getLeadsPage()
Section titled “crm.getLeadsPage()”getLeadsPage(limit, cursor?): Promise<Page<CRMLead>>;Get one page of CRM leads. Same cursor envelope as crm.getAccountsPage (iOS 5.5.0+, limit 1…5000). Prefer crm.eachLeadsPage or crm.query.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
limit |
number |
cursor? |
string |
Returns
Section titled “Returns”crm.eachLeadsPage()
Section titled “crm.eachLeadsPage()”eachLeadsPage(pageSize, handler): Promise<void>;Walk CRM leads page by page (meta.cursor.next only). Replaces removed getLeads().
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
pageSize |
number |
handler |
(chunk) => void | Promise<void> |
Returns
Section titled “Returns”Promise<void>
crm.getLead()
Section titled “crm.getLead()”getLead(leadID): Promise<CRMLead>;Get a specific CRM lead by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
leadID |
string |
The CRM lead ID to fetch. |
Returns
Section titled “Returns”Promise<CRMLead>
CRM lead record.
Throws
Section titled “Throws”MobileLockerCRMError on network failure, auth expiry, or server error.
crm.getUsersPage()
Section titled “crm.getUsersPage()”getUsersPage(limit, cursor?): Promise<Page<CRMUser>>;Get one page of CRM users. Same cursor envelope as crm.getAccountsPage (iOS 5.5.0+, limit 1…5000). Prefer crm.eachUsersPage or crm.query.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
limit |
number |
cursor? |
string |
Returns
Section titled “Returns”crm.eachUsersPage()
Section titled “crm.eachUsersPage()”eachUsersPage(pageSize, handler): Promise<void>;Walk CRM users page by page (meta.cursor.next only). Replaces removed getUsers().
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
pageSize |
number |
handler |
(chunk) => void | Promise<void> |
Returns
Section titled “Returns”Promise<void>
crm.getUser()
Section titled “crm.getUser()”getUser(userID): Promise<CRMUser>;Get a specific CRM user by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
userID |
string |
The CRM user ID to fetch. |
Returns
Section titled “Returns”Promise<CRMUser>
CRM user record.
Throws
Section titled “Throws”MobileLockerCRMError on network failure, auth expiry, or server error.
crm.openCustomerPicker()
Section titled “crm.openCustomerPicker()”openCustomerPicker(): Promise<PickerResult>;Open the native customer picker UI and let the user select one or more customers.
Returns
Section titled “Returns”Promise<PickerResult>
An object with status ('selected' or 'cancelled') and an optional customers array.
Remarks
Section titled “Remarks”iOS app only. Throws in all other environments.
Throws
Section titled “Throws”MobileLockerError if called outside the iOS app.
Throws
Section titled “Throws”MobileLockerCRMError on network failure or server error.
Example
Section titled “Example”const { status, customers } = await mobilelocker.crm.openCustomerPicker()if (status === 'selected') console.log(customers)crm.getCurrentCustomers()
Section titled “crm.getCurrentCustomers()”getCurrentCustomers(): Promise<Customer[]>;Get the customers currently associated with the active presentation session.
Returns
Section titled “Returns”Promise<Customer[]>
Array of Customer objects.
Throws
Section titled “Throws”MobileLockerCRMError on network failure or server error.
crm.getRecentCustomers()
Section titled “crm.getRecentCustomers()”getRecentCustomers(): Promise<Customer[]>;Get the customers most recently viewed by the current user.
Returns
Section titled “Returns”Promise<Customer[]>
Array of Customer objects, newest first.
Throws
Section titled “Throws”MobileLockerCRMError on network failure or server error.
crm.isCurrentCustomer()
Section titled “crm.isCurrentCustomer()”isCurrentCustomer(objectID): Promise<boolean>;Check whether a CRM object is currently associated with the active session.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
objectID |
string |
The CRM object ID to check (e.g. a Salesforce Account ID). |
Returns
Section titled “Returns”Promise<boolean>
true if the customer is current, false otherwise.
Throws
Section titled “Throws”MobileLockerCRMError on network failure or server error.
crm.setCurrentCustomers()
Section titled “crm.setCurrentCustomers()”setCurrentCustomers(customerIDs): Promise<void>;Replace the current customers for the active session.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
customerIDs |
string[] |
Array of CRM object IDs to set as current. |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”MobileLockerCRMError on network failure or server error.
crm.addCurrentCustomer()
Section titled “crm.addCurrentCustomer()”addCurrentCustomer(customerID): Promise<void>;Add a single customer to the current session without replacing existing ones.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
customerID |
string |
The CRM object ID of the customer to add. |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”MobileLockerCRMError on network failure or server error.
crm.removeCurrentCustomer()
Section titled “crm.removeCurrentCustomer()”removeCurrentCustomer(customerID): Promise<void>;Remove a single customer from the current session.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
customerID |
string |
The CRM object ID of the customer to remove. |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”MobileLockerCRMError on network failure or server error.
crm.clearCurrentCustomers()
Section titled “crm.clearCurrentCustomers()”clearCurrentCustomers(): Promise<void>;Remove all customers from the current session.
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”MobileLockerCRMError on network failure or server error.
crm.refresh()
Section titled “crm.refresh()”refresh(options?): Promise<CRMRefreshResult>;Trigger a CRM data refresh for the current user.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options? |
{ mode?: CRMRefreshMode; } |
- |
options.mode? |
CRMRefreshMode |
'incremental' (default) syncs only new/changed records; 'full' re-syncs everything. |
Returns
Section titled “Returns”Promise<CRMRefreshResult>
An object with status: 'started' if the refresh was queued, 'not_connected' if the CRM is unreachable.
Throws
Section titled “Throws”MobileLockerCRMError on auth expiry or server error.
Example
Section titled “Example”const { status } = await mobilelocker.crm.refresh({ mode: 'full' })crm.query()
Section titled “crm.query()”query(soql, parameters?): Promise<CRMQueryResult>;Execute a SOQL query against the connected CRM.
Prefer this over full offline walks when you need filtered CRM data.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
soql |
string |
A valid SOQL SELECT statement. |
parameters? |
Record<string, unknown> |
Optional named bind parameters referenced in the SOQL string. |
Returns
Section titled “Returns”Promise<CRMQueryResult>
A CRMQueryResult containing rows, totalSize, and done.
Throws
Section titled “Throws”MobileLockerCRMError with code SOQLInvalid on a syntax error, or on network/auth failure.
Example
Section titled “Example”const result = await mobilelocker.crm.query('SELECT Id, Name FROM Account WHERE Name = :name', { name: 'Acme' })data: { submitForm: void; getProducts: Promise<Product[]>; getProduct: Promise<Product>; getLabels: Promise<Label[]>; getLabel: Promise<Label>; getFolders: Promise<Folder[]>; getFolder: Promise<Folder>; getCustomers: Promise<Customer[]>; getCustomer: Promise<Customer>;};data.submitForm()
Section titled “data.submitForm()”submitForm(formName, formInput): void;Submit a data capture form event.
Records the form submission in the Mobile Locker analytics pipeline under
the 'data-capture' category. Use this to track lead forms, survey responses,
or any structured input the user submits during a presentation.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
formName |
string |
Identifier for the form (e.g. 'lead-form', 'product-interest'). |
formInput |
Record<string, unknown> |
Key/value pairs representing the form fields and their values. |
Returns
Section titled “Returns”void
Example
Section titled “Example”mobilelocker.data.submitForm('lead-form', { firstName: 'Jane', email: 'jane@example.com' })data.getProducts()
Section titled “data.getProducts()”getProducts(): Promise<Product[]>;Get all products available to the current team.
Returns
Section titled “Returns”Promise<Product[]>
Array of Product objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
data.getProduct()
Section titled “data.getProduct()”getProduct(id): Promise<Product>;Get a specific product by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id |
number |
The numeric product ID. |
Returns
Section titled “Returns”Promise<Product>
The matching Product.
Throws
Section titled “Throws”MobileLockerError on network failure or if not found.
data.getLabels()
Section titled “data.getLabels()”getLabels(): Promise<Label[]>;Get all labels available to the current team.
Returns
Section titled “Returns”Promise<Label[]>
Array of Label objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
data.getLabel()
Section titled “data.getLabel()”getLabel(id): Promise<Label>;Get a specific label by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id |
number |
The numeric label ID. |
Returns
Section titled “Returns”Promise<Label>
The matching Label.
Throws
Section titled “Throws”MobileLockerError on network failure or if not found.
data.getFolders()
Section titled “data.getFolders()”getFolders(): Promise<Folder[]>;Get all folders in the current user’s library.
Returns
Section titled “Returns”Promise<Folder[]>
Array of Folder objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
data.getFolder()
Section titled “data.getFolder()”getFolder(id): Promise<Folder>;Get a specific folder by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id |
number |
The numeric folder ID. |
Returns
Section titled “Returns”Promise<Folder>
The matching Folder.
Throws
Section titled “Throws”MobileLockerError on network failure or if not found.
data.getCustomers()
Section titled “data.getCustomers()”getCustomers(): Promise<Customer[]>;Get all customers synced for the current user.
Returns
Section titled “Returns”Promise<Customer[]>
Array of Customer objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
data.getCustomer()
Section titled “data.getCustomer()”getCustomer(id): Promise<Customer>;Get a specific customer by their CRM object ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id |
string |
The CRM object ID (e.g. a Salesforce 18-char ID). |
Returns
Section titled “Returns”Promise<Customer>
The matching Customer.
Throws
Section titled “Throws”MobileLockerError on network failure or if not found.
database
Section titled “database”database: { list: Promise<string[]>; describe: Promise<DatabaseTableDescription>; query: Promise<DatabaseQueryResult>;};database.list()
Section titled “database.list()”list(): Promise<string[]>;List the SQLite database files available to the current presentation.
Returns
Section titled “Returns”Promise<string[]>
Array of database file path strings.
Remarks
Section titled “Remarks”Returns an empty array outside the Mobile Locker app.
Throws
Section titled “Throws”MobileLockerDatabaseError on network failure or server error.
database.describe()
Section titled “database.describe()”describe(database, table): Promise<DatabaseTableDescription>;Describe the schema of a table in a SQLite database.
In local development, falls back to sql.js and reads the schema directly
from the database file via PRAGMA table_info.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
database |
string |
Path to the .sqlite file (relative to the presentation root). |
table |
string |
Name of the table to inspect. |
Returns
Section titled “Returns”Promise<DatabaseTableDescription>
A DatabaseTableDescription with name, sql, and columns.
Throws
Section titled “Throws”MobileLockerDatabaseError with code InvalidPath if the table does not exist.
Example
Section titled “Example”const schema = await mobilelocker.database.describe('data/products.sqlite', 'products')console.log(schema.columns.map(c => c.name))database.query()
Section titled “database.query()”query( path, sql,parameters?): Promise<DatabaseQueryResult>;Execute a SQL SELECT query against a SQLite database embedded in the presentation.
In local development, falls back to sql.js and fetches the database file directly.
Only SELECT statements are permitted — write operations throw WriteNotPermitted.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
path |
string |
undefined |
Path to the .sqlite file (relative to the presentation root). |
sql |
string |
undefined |
A SQL SELECT statement, optionally with ? or :name placeholders. |
parameters |
Record<string, unknown> | unknown[] |
[] |
Positional array or named object of bind parameters. |
Returns
Section titled “Returns”Promise<DatabaseQueryResult>
A DatabaseQueryResult with rows, rows_affected, and last_insert_row_id.
Throws
Section titled “Throws”MobileLockerDatabaseError with codes InvalidPath, WriteNotPermitted,
NotReady, QueryFailed, or NotConnected.
Example
Section titled “Example”const result = await mobilelocker.database.query( 'data/products.sqlite', 'SELECT * FROM products WHERE category = ?', ['widgets'])result.rows.forEach(row => console.log(row.name))presentation
Section titled “presentation”presentation: { get: Promise<Presentation>; getEvents: Promise<unknown[]>; getDeviceEvents: Promise<unknown[]>; reload: void; close: void; getAll: Promise<Presentation[]>; getByID: Promise<Presentation>; getByName: Promise<Presentation>; refresh: Promise<Presentation[]>; download: Promise<DownloadResult>; openByID: void; openByExternalID: Promise<void>; openByName: Promise<void>; openPicker: void;};presentation.get()
Section titled “presentation.get()”get(): Promise<Presentation>;Get the presentation that is currently open.
Returns
Section titled “Returns”Promise<Presentation>
The current Presentation.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
presentation.getEvents()
Section titled “presentation.getEvents()”getEvents(): Promise<unknown[]>;Get the analytics events recorded for the current presentation session.
Returns
Section titled “Returns”Promise<unknown[]>
Array of raw event objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
presentation.getDeviceEvents()
Section titled “presentation.getDeviceEvents()”getDeviceEvents(): Promise<unknown[]>;Alias for getEvents.
Returns
Section titled “Returns”Promise<unknown[]>
Array of raw event objects.
presentation.reload()
Section titled “presentation.reload()”reload(): void;Reload the current presentation’s web content.
Triggers a full page reload inside the presentation webview.
Returns
Section titled “Returns”void
presentation.close()
Section titled “presentation.close()”close(): void;Close the current presentation and return to the app home screen.
Prefers the dedicated host route POST /mobilelocker/api/close-presentation
(documented in the iOS web-server API). Falls back to the legacy
method=close-presentation analytics POST used by older app builds.
Returns
Section titled “Returns”void
presentation.getAll()
Section titled “presentation.getAll()”getAll(): Promise<Presentation[]>;Get all presentations available to the current user.
Returns
Section titled “Returns”Promise<Presentation[]>
Array of Presentation objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
presentation.getByID()
Section titled “presentation.getByID()”getByID(id): Promise<Presentation>;Get a presentation by its numeric ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id |
number |
The presentation ID. |
Returns
Section titled “Returns”Promise<Presentation>
The matching Presentation.
Throws
Section titled “Throws”MobileLockerError on network failure, or if not found.
presentation.getByName()
Section titled “presentation.getByName()”getByName(name): Promise<Presentation>;Get a presentation by its name.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
name |
string |
The presentation name (case-sensitive). |
Returns
Section titled “Returns”Promise<Presentation>
The matching Presentation.
Throws
Section titled “Throws”MobileLockerError on network failure, or if not found.
presentation.refresh()
Section titled “presentation.refresh()”refresh(): Promise<Presentation[]>;Refresh the list of available presentations from the server.
Returns
Section titled “Returns”Promise<Presentation[]>
Updated array of Presentation objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
presentation.download()
Section titled “presentation.download()”download(id): Promise<DownloadResult>;Queue a presentation for download to the device.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id |
number |
The numeric ID of the presentation to download. |
Returns
Section titled “Returns”Promise<DownloadResult>
An object with status: 'queued', 'already_installed', 'not_available', or 'not_permitted'.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
presentation.openByID()
Section titled “presentation.openByID()”openByID(id): void;Open a presentation by its numeric ID.
In the iOS app, triggers native presentation navigation via the app bridge. In a browser, opens the presentation in a new tab using the platform web URL.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id |
number |
The numeric ID of the presentation to open. |
Returns
Section titled “Returns”void
Example
Section titled “Example”mobilelocker.presentation.openByID(42)presentation.openByExternalID()
Section titled “presentation.openByExternalID()”openByExternalID(externalID): Promise<void>;Open a presentation by its external CRM ID.
In the iOS app, triggers native presentation navigation via the app bridge. In a browser, fetches all presentations, finds the match by external ID, then opens it.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
externalID |
string |
The external identifier for the presentation (e.g. a Salesforce ID). |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”MobileLockerError if no presentation with the given external ID is found.
Example
Section titled “Example”await mobilelocker.presentation.openByExternalID('a0B1234567890')presentation.openByName()
Section titled “presentation.openByName()”openByName(name): Promise<void>;Open a presentation by its name.
In the iOS app, triggers native presentation navigation via the app bridge. In a browser, fetches all presentations, finds the match by name, then opens it.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
name |
string |
The presentation name (case-sensitive). |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”MobileLockerError if no presentation with the given name is found.
Example
Section titled “Example”await mobilelocker.presentation.openByName('Kazaamax Rebate Calculator Demo');presentation.openPicker()
Section titled “presentation.openPicker()”openPicker(): void;Open the native presentation picker so the user can choose a presentation to open.
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”iOS app only. Throws in all other environments.
Throws
Section titled “Throws”MobileLockerError if called outside the iOS app.
search
Section titled “search”search: { query: Promise<SearchResults>;};search.query()
Section titled “search.query()”query(text, options?): Promise<SearchResults>;Search across multiple entity types simultaneously.
Returns results grouped by type. Use options.types to restrict the search
to specific entities and options.limit to control result set size per type.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
text |
string |
The search string. |
options |
SearchOptions |
Optional filter for entity types and result limit. |
Returns
Section titled “Returns”Promise<SearchResults>
A SearchResults object with a result set for each entity type.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
Example
Section titled “Example”const results = await mobilelocker.search.query('Acme', { types: ['customers'], limit: 10 })results.customers.results.forEach(c => console.log(c.name))Device
Section titled “Device”device
Section titled “device”device: { get: Promise<DeviceInfo | null>; isAtLeastVersion: Promise<boolean>;};device.get()
Section titled “device.get()”get(): Promise<DeviceInfo | null>;Get hardware and app metadata for the current device.
Returns
Section titled “Returns”Promise<DeviceInfo | null>
A DeviceInfo object, or null outside the iOS app.
Remarks
Section titled “Remarks”iOS app only. Returns null in all other environments.
Example
Section titled “Example”const info = await mobilelocker.device.get()if (info) console.log(info.app.version, info.hardware.model)device.isAtLeastVersion()
Section titled “device.isAtLeastVersion()”isAtLeastVersion(version): Promise<boolean>;Check whether the Mobile Locker app version meets a minimum requirement.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
version |
string |
Minimum required version string in major.minor.patch format (e.g. '5.2.0'). |
Returns
Section titled “Returns”Promise<boolean>
true if the current app version is equal to or greater than version.
Remarks
Section titled “Remarks”iOS app only. Returns false in all other environments.
Example
Section titled “Example”if (await mobilelocker.device.isAtLeastVersion('5.2.0')) { // use a feature introduced in 5.2.0}permissions
Section titled “permissions”permissions: { camera: Promise<PermissionResult>; microphone: Promise<PermissionResult>; photoLibrary: Promise<PermissionResult>; location: Promise<PermissionResult>; bluetooth: Promise<PermissionResult>; biometric: Promise<BiometricResult>;};permissions.camera()
Section titled “permissions.camera()”camera(): Promise<PermissionResult>;Check camera permission status.
Returns
Section titled “Returns”Promise<PermissionResult>
{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
permissions.microphone()
Section titled “permissions.microphone()”microphone(): Promise<PermissionResult>;Check microphone permission status.
Returns
Section titled “Returns”Promise<PermissionResult>
{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
permissions.photoLibrary()
Section titled “permissions.photoLibrary()”photoLibrary(): Promise<PermissionResult>;Check photo library permission status.
Returns
Section titled “Returns”Promise<PermissionResult>
{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
permissions.location()
Section titled “permissions.location()”location(): Promise<PermissionResult>;Check location permission status.
Returns
Section titled “Returns”Promise<PermissionResult>
{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
permissions.bluetooth()
Section titled “permissions.bluetooth()”bluetooth(): Promise<PermissionResult>;Check Bluetooth permission status.
Returns
Section titled “Returns”Promise<PermissionResult>
{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
permissions.biometric()
Section titled “permissions.biometric()”biometric(): Promise<BiometricResult>;Check biometric authentication availability.
Returns
Section titled “Returns”Promise<BiometricResult>
{ available, biometric_type, error } inside the iOS app; { available: false, biometric_type: 'unknown', error: null } elsewhere.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
scanner
Section titled “scanner”scanner: { scanBusinessCard: Promise<ScanResult>; scanBadge: Promise<ScanResult>;};scanner.scanBusinessCard()
Section titled “scanner.scanBusinessCard()”scanBusinessCard(eventID?): Promise<ScanResult>;Open the native business card scanner and capture a contact.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
eventID? |
number |
Optional lead retrieval event ID to associate the scan with. |
Returns
Section titled “Returns”Promise<ScanResult>
A ScanResult — check isSuccess before accessing businessCard.
Remarks
Section titled “Remarks”iOS app only. Throws in all other environments.
Long-lived host bridge: per-request timeout: 0, no automatic retry.
Throws
Section titled “Throws”MobileLockerError if called outside the iOS app.
Example
Section titled “Example”const result = await mobilelocker.scanner.scanBusinessCard()if (result.isSuccess) console.log(result.businessCard)scanner.scanBadge()
Section titled “scanner.scanBadge()”scanBadge(eventID): Promise<ScanResult>;Open the native badge scanner and capture an event attendee.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
eventID |
number |
The lead retrieval event ID to associate the scan with. |
Returns
Section titled “Returns”Promise<ScanResult>
A ScanResult — check isSuccess before accessing attendee.
Remarks
Section titled “Remarks”iOS app only. Throws in all other environments.
Long-lived host bridge: per-request timeout: 0, no automatic retry.
Throws
Section titled “Throws”MobileLockerError if called outside the iOS app.
Example
Section titled “Example”const result = await mobilelocker.scanner.scanBadge(eventID)if (result.isSuccess) console.log(result.attendee)Networking
Section titled “Networking”http: { get: Promise<HTTPResponse>; post: Promise<HTTPResponse>; put: Promise<HTTPResponse>; patch: Promise<HTTPResponse>; delete: Promise<HTTPResponse>; request: (url, options) => Promise<HTTPResponse>;};http.get()
Section titled “http.get()”get(url, options?): Promise<HTTPResponse>;Make a GET request to an external URL.
In the iOS app, requests are proxied through the native layer to bypass CORS.
In the browser, standard fetch is used and CORS rules apply.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
url |
string |
The full URL to request. |
options? |
HTTPOptions |
Optional headers, timeout, and response type. |
Returns
Section titled “Returns”Promise<HTTPResponse>
An HTTPResponse with status, statusText, headers, and data.
Throws
Section titled “Throws”MobileLockerHTTPError on network failure or timeout.
Throws
Section titled “Throws”MobileLockerHttpResponseError on non-2xx responses.
http.post()
Section titled “http.post()”post( url, body?,options?): Promise<HTTPResponse>;Make a POST request to an external URL.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
url |
string |
The full URL to request. |
body? |
unknown |
Request body, serialized as JSON. |
options? |
HTTPOptions |
Optional headers, timeout, and response type. |
Returns
Section titled “Returns”Promise<HTTPResponse>
An HTTPResponse.
Throws
Section titled “Throws”MobileLockerHTTPError on network failure or timeout.
Throws
Section titled “Throws”MobileLockerHttpResponseError on non-2xx responses.
http.put()
Section titled “http.put()”put( url, body?,options?): Promise<HTTPResponse>;Make a PUT request to an external URL.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
url |
string |
The full URL to request. |
body? |
unknown |
Request body, serialized as JSON. |
options? |
HTTPOptions |
Optional headers, timeout, and response type. |
Returns
Section titled “Returns”Promise<HTTPResponse>
An HTTPResponse.
Throws
Section titled “Throws”MobileLockerHTTPError on network failure or timeout.
Throws
Section titled “Throws”MobileLockerHttpResponseError on non-2xx responses.
http.patch()
Section titled “http.patch()”patch( url, body?,options?): Promise<HTTPResponse>;Make a PATCH request to an external URL.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
url |
string |
The full URL to request. |
body? |
unknown |
Request body, serialized as JSON. |
options? |
HTTPOptions |
Optional headers, timeout, and response type. |
Returns
Section titled “Returns”Promise<HTTPResponse>
An HTTPResponse.
Throws
Section titled “Throws”MobileLockerHTTPError on network failure or timeout.
Throws
Section titled “Throws”MobileLockerHttpResponseError on non-2xx responses.
http.delete()
Section titled “http.delete()”delete(url, options?): Promise<HTTPResponse>;Make a DELETE request to an external URL.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
url |
string |
The full URL to request. |
options? |
HTTPOptions |
Optional headers, timeout, and response type. |
Returns
Section titled “Returns”Promise<HTTPResponse>
An HTTPResponse.
Throws
Section titled “Throws”MobileLockerHTTPError on network failure or timeout.
Throws
Section titled “Throws”MobileLockerHttpResponseError on non-2xx responses.
http.request
Section titled “http.request”request: (url, options) => Promise<HTTPResponse>;Make an HTTP request with full control over method and options.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
url |
string |
The full URL to request. |
options |
HTTPRequestOptions |
Method, body, headers, timeout, and response type. |
Returns
Section titled “Returns”Promise<HTTPResponse>
An HTTPResponse.
Throws
Section titled “Throws”MobileLockerHTTPError on network failure or timeout.
Throws
Section titled “Throws”MobileLockerHttpResponseError on non-2xx responses.
network
Section titled “network”network: { getStatus: Promise<NetworkStatus>;};network.getStatus()
Section titled “network.getStatus()”getStatus(): Promise<NetworkStatus>;Get the current network connectivity status.
In the iOS app, returns accurate connection type from the native layer.
In the browser, falls back to navigator.onLine — note that this may
return true on captive portals even without real internet access.
Returns
Section titled “Returns”Promise<NetworkStatus>
A NetworkStatus object with connected and type.
Example
Section titled “Example”const { connected, type } = await mobilelocker.network.getStatus()if (!connected) showOfflineBanner()isMobileLocker
Section titled “isMobileLocker”isMobileLocker: () => boolean;Returns true when running in any Mobile Locker environment — either a native app or a CDN-hosted presentation.
When false, most SDK calls are no-ops or return local fallbacks, allowing development outside the platform.
Returns
Section titled “Returns”boolean
isApp: () => boolean;Returns true when running inside any Mobile Locker native app — iOS, iPadOS, Android, or Windows.
Use isIOS, isAndroid, or isWindows if you need to target a specific platform.
Returns
Section titled “Returns”boolean
isCDN: () => boolean;Returns true when the presentation is served from a Mobile Locker CDN hostname
(e.g. app.mobilelocker.com, *.app.mobilelocker.com, *.eu.mobilelocker.com).
Returns
Section titled “Returns”boolean
isIOS: () => boolean;Returns true when running inside the Mobile Locker iOS or iPadOS app specifically.
Detected via the IS_MOBILE_LOCKER_IOS_APP window flag or the mobilelocker-ios /
mobilelocker-ipados user agent prefix.
Use isApp if you want to match any native app environment.
Returns
Section titled “Returns”boolean
isAndroid
Section titled “isAndroid”isAndroid: () => boolean;Returns true when running inside the Mobile Locker Android app.
Detected via the IS_MOBILE_LOCKER_ANDROID_APP window flag or the
mobilelocker-android user agent prefix.
Returns
Section titled “Returns”boolean
isWindows
Section titled “isWindows”isWindows: () => boolean;Returns true when running inside the Mobile Locker Windows app.
Detected via the IS_MOBILE_LOCKER_WINDOWS_APP window flag, the
mobilelocker-windows user agent prefix, or isElectron (current Windows shell).
Use isApp if you want to match any native app environment.
Returns
Section titled “Returns”boolean
isElectron
Section titled “isElectron”isElectron: () => boolean;Returns true when running inside the Mobile Locker Electron desktop app.
Detected via the Mobile Locker user agent prefix set by the Electron app.
Prefer isWindows when targeting the Windows app rather than Electron specifically.
Use isApp if you want to match any native app environment.
Returns
Section titled “Returns”boolean
MobileLockerError
Section titled “MobileLockerError”MobileLockerError: typeof MobileLockerError;notificationLevels
Section titled “notificationLevels”notificationLevels: { NOTIFY_NONE: number; NOTIFY_FIRST: number; NOTIFY_EVERY: number; NOTIFY_WEEKLY: number; NOTIFY_MONTHLY: number;};notificationLevels.NOTIFY_NONE
Section titled “notificationLevels.NOTIFY_NONE”NOTIFY_NONE: number = 0;notificationLevels.NOTIFY_FIRST
Section titled “notificationLevels.NOTIFY_FIRST”NOTIFY_FIRST: number = 1;notificationLevels.NOTIFY_EVERY
Section titled “notificationLevels.NOTIFY_EVERY”NOTIFY_EVERY: number = 2;notificationLevels.NOTIFY_WEEKLY
Section titled “notificationLevels.NOTIFY_WEEKLY”NOTIFY_WEEKLY: number = 3;notificationLevels.NOTIFY_MONTHLY
Section titled “notificationLevels.NOTIFY_MONTHLY”NOTIFY_MONTHLY: number = 4;Storage
Section titled “Storage”localforage
Section titled “localforage”localforage: MobileLockerLocalForage;storage
Section titled “storage”storage: { get: Promise<StorageEntry | null>; getAll: Promise<StorageEntry[]>; getAllAcrossPresentations: Promise<StorageEntry[]>; getForPresentation: Promise<StorageEntry[]>; query: Promise<StorageEntry[]>; search: Promise<StorageEntry[]>; save: Promise<StorageEntry>; delete: Promise<void>;};storage.get()
Section titled “storage.get()”get(name): Promise<StorageEntry | null>;Get a single storage entry by name for the current presentation and user.
On Mobile Locker app hosts that implement
GET /user/user-storage-entries/item?name=, this is a single-key read.
Older hosts fall back to listing current-presentation entries.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
name |
string |
The key name of the entry to retrieve. |
Returns
Section titled “Returns”Promise<StorageEntry | null>
The matching StorageEntry, or null if not found.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
storage.getAll()
Section titled “storage.getAll()”getAll(): Promise<StorageEntry[]>;Get all storage entries for the current presentation and user.
Returns
Section titled “Returns”Promise<StorageEntry[]>
Array of StorageEntry objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
storage.getAllAcrossPresentations()
Section titled “storage.getAllAcrossPresentations()”getAllAcrossPresentations(): Promise<StorageEntry[]>;Get all storage entries for the current user across every presentation.
Returns
Section titled “Returns”Promise<StorageEntry[]>
Array of StorageEntry objects.
Remarks
Section titled “Remarks”Previously misnamed getAllForPresentation (that name hit this same
unrestricted list endpoint). Use getAll for the current presentation only.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
storage.getForPresentation()
Section titled “storage.getForPresentation()”getForPresentation(presentationID): Promise<StorageEntry[]>;Get all storage entries for a specific presentation by ID.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
presentationID |
number |
The numeric ID of the presentation. |
Returns
Section titled “Returns”Promise<StorageEntry[]>
Array of StorageEntry objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
storage.query()
Section titled “storage.query()”query(filter?): Promise<StorageEntry[]>;Query storage entries with optional filtering.
Outside the Mobile Locker app, filters are applied locally against IndexedDB.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
filter? |
StorageFilter |
Optional filter by name, presentation, date range, and limit. |
Returns
Section titled “Returns”Promise<StorageEntry[]>
Array of matching StorageEntry objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
Example
Section titled “Example”const entries = await mobilelocker.storage.query({ name: 'scan-results', limit: 10 })storage.search()
Section titled “storage.search()”search(text, filter?): Promise<StorageEntry[]>;Full-text search across storage entry names and data.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
text |
string |
The search string. Matched against name and the stringified data. |
filter? |
StorageFilter |
Optional pre-filter applied before the text search. |
Returns
Section titled “Returns”Promise<StorageEntry[]>
Array of matching StorageEntry objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
storage.save()
Section titled “storage.save()”save(name, data): Promise<StorageEntry>;Save a value to storage under the given name.
Creates a new entry if one does not exist, or updates the existing entry. Outside the Mobile Locker app, persists to IndexedDB via localforage.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
name |
string |
The key name for the entry. |
data |
unknown |
Any JSON-serializable value to store. |
Returns
Section titled “Returns”Promise<StorageEntry>
The saved StorageEntry.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
Example
Section titled “Example”await mobilelocker.storage.save('scan-results', { leads: [...] })storage.delete()
Section titled “storage.delete()”delete(name): Promise<void>;Delete the storage entry with the given name.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
name |
string |
The key name of the entry to delete. |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
share: { presentation: void; email: void;};share.presentation()
Section titled “share.presentation()”presentation( recipients, notificationLevel?, sendReminders?): void;Share the current presentation with one or more recipients.
Sends the presentation link via the Mobile Locker platform. No-op outside the Mobile Locker environment (e.g. local development).
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
recipients |
ShareRecipient[] |
undefined |
One or more recipients, each requiring at least an email. |
notificationLevel |
number |
2 |
Controls when recipients receive email notifications. Use the mobilelocker.notificationLevels constants. Defaults to NOTIFY_EVERY (2). |
sendReminders |
boolean |
true |
Whether to send follow-up reminder emails. Defaults to true. |
Returns
Section titled “Returns”void
Throws
Section titled “Throws”MobileLockerError if recipients is empty or any recipient is missing an email.
Example
Section titled “Example”mobilelocker.share.presentation( [{ email: 'jane@example.com', name: 'Jane' }], mobilelocker.notificationLevels.NOTIFY_FIRST,)share.email()
Section titled “share.email()”email( to, subject, body?, attachment?, template?, formData?): void;Send an email through the Mobile Locker platform.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
to |
| string | { name?: string; email: string; } |
undefined |
Recipient email string, or an object with email and optional name. |
subject |
string |
undefined |
Email subject line. |
body |
string | null |
null |
Optional email body text. |
attachment |
string | null |
null |
Optional path to a file to attach. |
template |
string | null |
null |
Optional email template identifier. |
formData |
unknown |
null |
Optional additional form data to include with the email record. |
Returns
Section titled “Returns”void
Example
Section titled “Example”mobilelocker.share.email( { name: 'Jane', email: 'jane@example.com' }, 'Thanks for stopping by', 'It was great meeting you at the conference.',)ui: { openPDF: void; showToolbar: void; openVideo: Promise<VideoResult>;};ui.openPDF()
Section titled “ui.openPDF()”openPDF( pdfPath, title, customOptions?): void;Open a PDF file in the platform viewer.
In the iOS app, opens the native PDF viewer with annotation support. In the browser, opens the file in a new tab.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pdfPath |
string |
Path to the PDF file, relative to the presentation root. |
title |
string |
Display title for the viewer. |
customOptions? |
Record<string, unknown> |
Optional extra properties passed through to the analytics event. |
Returns
Section titled “Returns”void
Example
Section titled “Example”mobilelocker.ui.openPDF('/files/brochure.pdf', 'Product Brochure')ui.showToolbar()
Section titled “ui.showToolbar()”showToolbar(): void;Show the app navigation toolbar.
Returns
Section titled “Returns”void
Remarks
Section titled “Remarks”iOS app only. Throws in all other environments.
Throws
Section titled “Throws”MobileLockerError if called outside the iOS app.
ui.openVideo()
Section titled “ui.openVideo()”openVideo(path, options?): Promise<VideoResult>;Open a video file in the platform player.
In the iOS app, uses the native AVPlayer with full option support.
In the browser, renders a full-viewport <video> overlay. Click outside
the video to dismiss it.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
path |
string |
Path to the video file, relative to the presentation root. |
options |
VideoOptions |
Playback options (autoplay, loop, controls, speed, etc.). |
Returns
Section titled “Returns”Promise<VideoResult>
A VideoResult with status and final playback position in seconds.
Example
Section titled “Example”const result = await mobilelocker.ui.openVideo('/files/demo.mp4', { autoplay: true, showControls: true })if (result.status === 'completed') console.log(`Watched to ${result.position}s`)