Skip to content

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

analytics: {
logEvent: void;
};
logEvent(
category,
action,
uri,
data?,
method?): void;

Track a custom analytics event.

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'.

void

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;
};
setMode(enabled): void;

Enable or disable debug mode.

Parameter Type Description
enabled boolean Pass true to enable, false to disable.

void

isEnabled(): boolean;

Check whether debug mode is currently enabled.

boolean

true if debug mode is on.

liveMode(uri?): void;

Mark the current session as a live (non-practice) presentation.

Parameter Type Default value Description
uri string '' Optional URI or identifier to associate with the event.

void

practiceMode(uri?): void;

Mark the current session as a practice presentation.

Parameter Type Default value Description
uri string '' Optional URI or identifier to associate with the event.

void

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).

Parameter Type Description
filter? SDKLogFilter Optional filter by level, domain, function, date range, retries, and limit.

Promise<SDKLogEntry[]>

Array of SDKLogEntry objects, newest first.

MobileLockerError on network failure or server error.

const errors = await mobilelocker.log.getSdkLogs({ level: 'error', domain: 'crm' })
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.

Parameter Type Description
text string The search string.
filter? SDKLogFilter Optional pre-filter applied before the text search.

Promise<SDKLogEntry[]>

Array of matching SDKLogEntry objects.

MobileLockerError on network failure or server error.

debug(message, metadata?): void;

Write a debug-level log entry into the SDK log store.

Parameter Type Description
message string Human-readable description of the event.
metadata? Record<string, unknown> Optional key/value data to attach to the entry.

void

info(message, metadata?): void;

Write an info-level log entry into the SDK log store.

Parameter Type Description
message string Human-readable description of the event.
metadata? Record<string, unknown> Optional key/value data to attach to the entry.

void

mobilelocker.log.info('User selected product', { productId: 42, slide: 'overview' })
warn(message, metadata?): void;

Write a warn-level log entry into the SDK log store.

Parameter Type Description
message string Human-readable description of the event.
metadata? Record<string, unknown> Optional key/value data to attach to the entry.

void

error(message, metadata?): void;

Write an error-level log entry into the SDK log store.

Parameter Type Description
message string Human-readable description of the event.
metadata? Record<string, unknown> Optional key/value data to attach to the entry.

void

session: {
getDeviceEvents: Promise<unknown[]>;
get hitSessionId(): string | null;
};
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.

Promise<unknown[]>

Array of raw event objects.

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.

string | null

user: {
get: Promise<User>;
};
get(): Promise<User>;

Get the currently authenticated user.

Promise<User>

The authenticated User.

MobileLockerError on network failure or server error.

const u = await mobilelocker.user.get()
console.log(`Hello, ${u.name}`)
congresses: {
list: Promise<Event[]>;
get: Promise<Event>;
getAttendees: Promise<Attendee[]>;
getAttendee: Promise<Attendee>;
getBusinessCards: Promise<BusinessCard[]>;
getBusinessCard: Promise<BusinessCard>;
};
list(): Promise<Event[]>;

List all lead retrieval events available to the current user.

Promise<Event[]>

Array of Event objects.

MobileLockerError on network failure or server error.

get(eventID): Promise<Event>;

Get a single lead retrieval event by ID.

Parameter Type Description
eventID number The numeric ID of the event.

Promise<Event>

The matching Event.

MobileLockerError on network failure or if the event is not found.

getAttendees(eventID): Promise<Attendee[]>;

Get all attendees for a lead retrieval event.

Parameter Type Description
eventID number The numeric ID of the event.

Promise<Attendee[]>

Array of Attendee objects.

MobileLockerError on network failure or server error.

getAttendee(attendeeID): Promise<Attendee>;

Get a specific attendee by ID.

Parameter Type Description
attendeeID string The attendee’s string ID.

Promise<Attendee>

The matching Attendee.

MobileLockerError on network failure or if not found.

getBusinessCards(): Promise<BusinessCard[]>;

Get all business cards scanned by the current user.

Promise<BusinessCard[]>

Array of BusinessCard objects.

MobileLockerError on network failure or server error.

getBusinessCard(cardID): Promise<BusinessCard>;

Get a specific business card by ID.

Parameter Type Description
cardID string The business card’s string ID.

Promise<BusinessCard>

The matching BusinessCard.

MobileLockerError on network failure or if not found.

contacts: {
get: Promise<UserContact>;
getPage: Promise<Page<UserContact>>;
eachPage: Promise<void>;
};
get(contactID): Promise<UserContact>;

Get a specific contact by ID.

Parameter Type Description
contactID number The ID of the contact to fetch.

Promise<UserContact>

A UserContact object.

MobileLockerError on network failure or server error.

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).

Parameter Type Description
limit number Page size (1…5000).
cursor? string From previous meta.cursor.next. Omit for the first page.

Promise<Page<UserContact>>

Page of UserContact records.

MobileLockerError with code InvalidArgument when limit is out of range.

MobileLockerError on network failure or server error.

const page = await mobilelocker.contacts.getPage(500)
const next = page.meta.cursor.next
? await mobilelocker.contacts.getPage(500, page.meta.cursor.next)
: null
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+.

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.

Promise<void>

MobileLockerError when pageSize is out of range, or on network/server error.

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>;
};
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.

Parameter Type Description
limit number Page size (1…5000).
cursor? string From previous meta.cursor.next. Omit for the first page.

Promise<Page<CRMAccount>>

Page of CRMAccount records.

MobileLockerError with code InvalidArgument when limit is out of range.

MobileLockerCRMError on network failure, auth expiry, or server error.

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+.

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.

Promise<void>

MobileLockerError when pageSize is out of range.

MobileLockerCRMError on network/server error.

await mobilelocker.crm.eachAccountsPage(500, (chunk) => {
for (const account of chunk) {
// handle one account — never accumulate the full table
}
})
getAccount(accountID): Promise<CRMAccount>;

Get a specific CRM account by ID.

Parameter Type Description
accountID string The CRM account ID to fetch.

Promise<CRMAccount>

CRM account record.

MobileLockerCRMError on network failure, auth expiry, or server error.

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.

Parameter Type
limit number
cursor? string

Promise<Page<CRMAddress>>

eachAddressesPage(pageSize, handler): Promise<void>;

Walk CRM addresses page by page (meta.cursor.next only). Replaces removed getAddresses().

Parameter Type
pageSize number
handler (chunk) => void | Promise<void>

Promise<void>

getAddress(addressID): Promise<CRMAddress>;

Get a specific CRM address by ID.

Parameter Type Description
addressID string The CRM address ID to fetch.

Promise<CRMAddress>

CRM address record.

MobileLockerCRMError on network failure, auth expiry, or server error.

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.

Parameter Type
limit number
cursor? string

Promise<Page<CRMContact>>

eachContactsPage(pageSize, handler): Promise<void>;

Walk CRM contacts page by page (meta.cursor.next only). Replaces removed getContacts().

Parameter Type
pageSize number
handler (chunk) => void | Promise<void>

Promise<void>

await mobilelocker.crm.eachContactsPage(500, (chunk) => {
for (const contact of chunk) {
// handle one contact
}
})
getContact(contactID): Promise<CRMContact>;

Get a specific CRM contact by ID.

Parameter Type Description
contactID string The CRM contact ID to fetch.

Promise<CRMContact>

CRM contact record.

MobileLockerCRMError on network failure, auth expiry, or server error.

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.

Parameter Type
limit number
cursor? string

Promise<Page<CRMLead>>

eachLeadsPage(pageSize, handler): Promise<void>;

Walk CRM leads page by page (meta.cursor.next only). Replaces removed getLeads().

Parameter Type
pageSize number
handler (chunk) => void | Promise<void>

Promise<void>

getLead(leadID): Promise<CRMLead>;

Get a specific CRM lead by ID.

Parameter Type Description
leadID string The CRM lead ID to fetch.

Promise<CRMLead>

CRM lead record.

MobileLockerCRMError on network failure, auth expiry, or server error.

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.

Parameter Type
limit number
cursor? string

Promise<Page<CRMUser>>

eachUsersPage(pageSize, handler): Promise<void>;

Walk CRM users page by page (meta.cursor.next only). Replaces removed getUsers().

Parameter Type
pageSize number
handler (chunk) => void | Promise<void>

Promise<void>

getUser(userID): Promise<CRMUser>;

Get a specific CRM user by ID.

Parameter Type Description
userID string The CRM user ID to fetch.

Promise<CRMUser>

CRM user record.

MobileLockerCRMError on network failure, auth expiry, or server error.

openCustomerPicker(): Promise<PickerResult>;

Open the native customer picker UI and let the user select one or more customers.

Promise<PickerResult>

An object with status ('selected' or 'cancelled') and an optional customers array.

iOS app only. Throws in all other environments.

MobileLockerError if called outside the iOS app.

MobileLockerCRMError on network failure or server error.

const { status, customers } = await mobilelocker.crm.openCustomerPicker()
if (status === 'selected') console.log(customers)
getCurrentCustomers(): Promise<Customer[]>;

Get the customers currently associated with the active presentation session.

Promise<Customer[]>

Array of Customer objects.

MobileLockerCRMError on network failure or server error.

getRecentCustomers(): Promise<Customer[]>;

Get the customers most recently viewed by the current user.

Promise<Customer[]>

Array of Customer objects, newest first.

MobileLockerCRMError on network failure or server error.

isCurrentCustomer(objectID): Promise<boolean>;

Check whether a CRM object is currently associated with the active session.

Parameter Type Description
objectID string The CRM object ID to check (e.g. a Salesforce Account ID).

Promise<boolean>

true if the customer is current, false otherwise.

MobileLockerCRMError on network failure or server error.

setCurrentCustomers(customerIDs): Promise<void>;

Replace the current customers for the active session.

Parameter Type Description
customerIDs string[] Array of CRM object IDs to set as current.

Promise<void>

MobileLockerCRMError on network failure or server error.

addCurrentCustomer(customerID): Promise<void>;

Add a single customer to the current session without replacing existing ones.

Parameter Type Description
customerID string The CRM object ID of the customer to add.

Promise<void>

MobileLockerCRMError on network failure or server error.

removeCurrentCustomer(customerID): Promise<void>;

Remove a single customer from the current session.

Parameter Type Description
customerID string The CRM object ID of the customer to remove.

Promise<void>

MobileLockerCRMError on network failure or server error.

clearCurrentCustomers(): Promise<void>;

Remove all customers from the current session.

Promise<void>

MobileLockerCRMError on network failure or server error.

refresh(options?): Promise<CRMRefreshResult>;

Trigger a CRM data refresh for the current user.

Parameter Type Description
options? { mode?: CRMRefreshMode; } -
options.mode? CRMRefreshMode 'incremental' (default) syncs only new/changed records; 'full' re-syncs everything.

Promise<CRMRefreshResult>

An object with status: 'started' if the refresh was queued, 'not_connected' if the CRM is unreachable.

MobileLockerCRMError on auth expiry or server error.

const { status } = await mobilelocker.crm.refresh({ mode: 'full' })
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.

Parameter Type Description
soql string A valid SOQL SELECT statement.
parameters? Record<string, unknown> Optional named bind parameters referenced in the SOQL string.

Promise<CRMQueryResult>

A CRMQueryResult containing rows, totalSize, and done.

MobileLockerCRMError with code SOQLInvalid on a syntax error, or on network/auth failure.

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>;
};
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.

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.

void

mobilelocker.data.submitForm('lead-form', { firstName: 'Jane', email: 'jane@example.com' })
getProducts(): Promise<Product[]>;

Get all products available to the current team.

Promise<Product[]>

Array of Product objects.

MobileLockerError on network failure or server error.

getProduct(id): Promise<Product>;

Get a specific product by ID.

Parameter Type Description
id number The numeric product ID.

Promise<Product>

The matching Product.

MobileLockerError on network failure or if not found.

getLabels(): Promise<Label[]>;

Get all labels available to the current team.

Promise<Label[]>

Array of Label objects.

MobileLockerError on network failure or server error.

getLabel(id): Promise<Label>;

Get a specific label by ID.

Parameter Type Description
id number The numeric label ID.

Promise<Label>

The matching Label.

MobileLockerError on network failure or if not found.

getFolders(): Promise<Folder[]>;

Get all folders in the current user’s library.

Promise<Folder[]>

Array of Folder objects.

MobileLockerError on network failure or server error.

getFolder(id): Promise<Folder>;

Get a specific folder by ID.

Parameter Type Description
id number The numeric folder ID.

Promise<Folder>

The matching Folder.

MobileLockerError on network failure or if not found.

getCustomers(): Promise<Customer[]>;

Get all customers synced for the current user.

Promise<Customer[]>

Array of Customer objects.

MobileLockerError on network failure or server error.

getCustomer(id): Promise<Customer>;

Get a specific customer by their CRM object ID.

Parameter Type Description
id string The CRM object ID (e.g. a Salesforce 18-char ID).

Promise<Customer>

The matching Customer.

MobileLockerError on network failure or if not found.

database: {
list: Promise<string[]>;
describe: Promise<DatabaseTableDescription>;
query: Promise<DatabaseQueryResult>;
};
list(): Promise<string[]>;

List the SQLite database files available to the current presentation.

Promise<string[]>

Array of database file path strings.

Returns an empty array outside the Mobile Locker app.

MobileLockerDatabaseError on network failure or server error.

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.

Parameter Type Description
database string Path to the .sqlite file (relative to the presentation root).
table string Name of the table to inspect.

Promise<DatabaseTableDescription>

A DatabaseTableDescription with name, sql, and columns.

MobileLockerDatabaseError with code InvalidPath if the table does not exist.

const schema = await mobilelocker.database.describe('data/products.sqlite', 'products')
console.log(schema.columns.map(c => c.name))
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.

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.

Promise<DatabaseQueryResult>

A DatabaseQueryResult with rows, rows_affected, and last_insert_row_id.

MobileLockerDatabaseError with codes InvalidPath, WriteNotPermitted, NotReady, QueryFailed, or NotConnected.

const result = await mobilelocker.database.query(
'data/products.sqlite',
'SELECT * FROM products WHERE category = ?',
['widgets']
)
result.rows.forEach(row => console.log(row.name))
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;
};
get(): Promise<Presentation>;

Get the presentation that is currently open.

Promise<Presentation>

The current Presentation.

MobileLockerError on network failure or server error.

getEvents(): Promise<unknown[]>;

Get the analytics events recorded for the current presentation session.

Promise<unknown[]>

Array of raw event objects.

MobileLockerError on network failure or server error.

getDeviceEvents(): Promise<unknown[]>;

Alias for getEvents.

Promise<unknown[]>

Array of raw event objects.

reload(): void;

Reload the current presentation’s web content.

Triggers a full page reload inside the presentation webview.

void

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.

void

getAll(): Promise<Presentation[]>;

Get all presentations available to the current user.

Promise<Presentation[]>

Array of Presentation objects.

MobileLockerError on network failure or server error.

getByID(id): Promise<Presentation>;

Get a presentation by its numeric ID.

Parameter Type Description
id number The presentation ID.

Promise<Presentation>

The matching Presentation.

MobileLockerError on network failure, or if not found.

getByName(name): Promise<Presentation>;

Get a presentation by its name.

Parameter Type Description
name string The presentation name (case-sensitive).

Promise<Presentation>

The matching Presentation.

MobileLockerError on network failure, or if not found.

refresh(): Promise<Presentation[]>;

Refresh the list of available presentations from the server.

Promise<Presentation[]>

Updated array of Presentation objects.

MobileLockerError on network failure or server error.

download(id): Promise<DownloadResult>;

Queue a presentation for download to the device.

Parameter Type Description
id number The numeric ID of the presentation to download.

Promise<DownloadResult>

An object with status: 'queued', 'already_installed', 'not_available', or 'not_permitted'.

MobileLockerError on network failure or server error.

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.

Parameter Type Description
id number The numeric ID of the presentation to open.

void

mobilelocker.presentation.openByID(42)
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.

Parameter Type Description
externalID string The external identifier for the presentation (e.g. a Salesforce ID).

Promise<void>

MobileLockerError if no presentation with the given external ID is found.

await mobilelocker.presentation.openByExternalID('a0B1234567890')
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.

Parameter Type Description
name string The presentation name (case-sensitive).

Promise<void>

MobileLockerError if no presentation with the given name is found.

await mobilelocker.presentation.openByName('Kazaamax Rebate Calculator Demo');
openPicker(): void;

Open the native presentation picker so the user can choose a presentation to open.

void

iOS app only. Throws in all other environments.

MobileLockerError if called outside the iOS app.

search: {
query: Promise<SearchResults>;
};
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.

Parameter Type Description
text string The search string.
options SearchOptions Optional filter for entity types and result limit.

Promise<SearchResults>

A SearchResults object with a result set for each entity type.

MobileLockerError on network failure or server error.

const results = await mobilelocker.search.query('Acme', { types: ['customers'], limit: 10 })
results.customers.results.forEach(c => console.log(c.name))
device: {
get: Promise<DeviceInfo | null>;
isAtLeastVersion: Promise<boolean>;
};
get(): Promise<DeviceInfo | null>;

Get hardware and app metadata for the current device.

Promise<DeviceInfo | null>

A DeviceInfo object, or null outside the iOS app.

iOS app only. Returns null in all other environments.

const info = await mobilelocker.device.get()
if (info) console.log(info.app.version, info.hardware.model)
isAtLeastVersion(version): Promise<boolean>;

Check whether the Mobile Locker app version meets a minimum requirement.

Parameter Type Description
version string Minimum required version string in major.minor.patch format (e.g. '5.2.0').

Promise<boolean>

true if the current app version is equal to or greater than version.

iOS app only. Returns false in all other environments.

if (await mobilelocker.device.isAtLeastVersion('5.2.0')) {
// use a feature introduced in 5.2.0
}
permissions: {
camera: Promise<PermissionResult>;
microphone: Promise<PermissionResult>;
photoLibrary: Promise<PermissionResult>;
location: Promise<PermissionResult>;
bluetooth: Promise<PermissionResult>;
biometric: Promise<BiometricResult>;
};
camera(): Promise<PermissionResult>;

Check camera permission status.

Promise<PermissionResult>

{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.

MobileLockerError on network failure or server error.

microphone(): Promise<PermissionResult>;

Check microphone permission status.

Promise<PermissionResult>

{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.

MobileLockerError on network failure or server error.

photoLibrary(): Promise<PermissionResult>;

Check photo library permission status.

Promise<PermissionResult>

{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.

MobileLockerError on network failure or server error.

location(): Promise<PermissionResult>;

Check location permission status.

Promise<PermissionResult>

{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.

MobileLockerError on network failure or server error.

bluetooth(): Promise<PermissionResult>;

Check Bluetooth permission status.

Promise<PermissionResult>

{ status, granted } inside the iOS app; { status: 'not_determined', granted: false } elsewhere.

MobileLockerError on network failure or server error.

biometric(): Promise<BiometricResult>;

Check biometric authentication availability.

Promise<BiometricResult>

{ available, biometric_type, error } inside the iOS app; { available: false, biometric_type: 'unknown', error: null } elsewhere.

MobileLockerError on network failure or server error.

scanner: {
scanBusinessCard: Promise<ScanResult>;
scanBadge: Promise<ScanResult>;
};
scanBusinessCard(eventID?): Promise<ScanResult>;

Open the native business card scanner and capture a contact.

Parameter Type Description
eventID? number Optional lead retrieval event ID to associate the scan with.

Promise<ScanResult>

A ScanResult — check isSuccess before accessing businessCard.

iOS app only. Throws in all other environments. Long-lived host bridge: per-request timeout: 0, no automatic retry.

MobileLockerError if called outside the iOS app.

const result = await mobilelocker.scanner.scanBusinessCard()
if (result.isSuccess) console.log(result.businessCard)
scanBadge(eventID): Promise<ScanResult>;

Open the native badge scanner and capture an event attendee.

Parameter Type Description
eventID number The lead retrieval event ID to associate the scan with.

Promise<ScanResult>

A ScanResult — check isSuccess before accessing attendee.

iOS app only. Throws in all other environments. Long-lived host bridge: per-request timeout: 0, no automatic retry.

MobileLockerError if called outside the iOS app.

const result = await mobilelocker.scanner.scanBadge(eventID)
if (result.isSuccess) console.log(result.attendee)
http: {
get: Promise<HTTPResponse>;
post: Promise<HTTPResponse>;
put: Promise<HTTPResponse>;
patch: Promise<HTTPResponse>;
delete: Promise<HTTPResponse>;
request: (url, options) => Promise<HTTPResponse>;
};
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.

Parameter Type Description
url string The full URL to request.
options? HTTPOptions Optional headers, timeout, and response type.

Promise<HTTPResponse>

An HTTPResponse with status, statusText, headers, and data.

MobileLockerHTTPError on network failure or timeout.

MobileLockerHttpResponseError on non-2xx responses.

post(
url,
body?,
options?): Promise<HTTPResponse>;

Make a POST request to an external URL.

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.

Promise<HTTPResponse>

An HTTPResponse.

MobileLockerHTTPError on network failure or timeout.

MobileLockerHttpResponseError on non-2xx responses.

put(
url,
body?,
options?): Promise<HTTPResponse>;

Make a PUT request to an external URL.

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.

Promise<HTTPResponse>

An HTTPResponse.

MobileLockerHTTPError on network failure or timeout.

MobileLockerHttpResponseError on non-2xx responses.

patch(
url,
body?,
options?): Promise<HTTPResponse>;

Make a PATCH request to an external URL.

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.

Promise<HTTPResponse>

An HTTPResponse.

MobileLockerHTTPError on network failure or timeout.

MobileLockerHttpResponseError on non-2xx responses.

delete(url, options?): Promise<HTTPResponse>;

Make a DELETE request to an external URL.

Parameter Type Description
url string The full URL to request.
options? HTTPOptions Optional headers, timeout, and response type.

Promise<HTTPResponse>

An HTTPResponse.

MobileLockerHTTPError on network failure or timeout.

MobileLockerHttpResponseError on non-2xx responses.

request: (url, options) => Promise<HTTPResponse>;

Make an HTTP request with full control over method and options.

Parameter Type Description
url string The full URL to request.
options HTTPRequestOptions Method, body, headers, timeout, and response type.

Promise<HTTPResponse>

An HTTPResponse.

MobileLockerHTTPError on network failure or timeout.

MobileLockerHttpResponseError on non-2xx responses.

network: {
getStatus: Promise<NetworkStatus>;
};
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.

Promise<NetworkStatus>

A NetworkStatus object with connected and type.

const { connected, type } = await mobilelocker.network.getStatus()
if (!connected) showOfflineBanner()
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.

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.

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).

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.

boolean

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.

boolean

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.

boolean

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.

boolean

MobileLockerError: typeof MobileLockerError;
notificationLevels: {
NOTIFY_NONE: number;
NOTIFY_FIRST: number;
NOTIFY_EVERY: number;
NOTIFY_WEEKLY: number;
NOTIFY_MONTHLY: number;
};
NOTIFY_NONE: number = 0;
NOTIFY_FIRST: number = 1;
NOTIFY_EVERY: number = 2;
NOTIFY_WEEKLY: number = 3;
NOTIFY_MONTHLY: number = 4;
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>;
};
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.

Parameter Type Description
name string The key name of the entry to retrieve.

Promise<StorageEntry | null>

The matching StorageEntry, or null if not found.

MobileLockerError on network failure or server error.

getAll(): Promise<StorageEntry[]>;

Get all storage entries for the current presentation and user.

Promise<StorageEntry[]>

Array of StorageEntry objects.

MobileLockerError on network failure or server error.

getAllAcrossPresentations(): Promise<StorageEntry[]>;

Get all storage entries for the current user across every presentation.

Promise<StorageEntry[]>

Array of StorageEntry objects.

Previously misnamed getAllForPresentation (that name hit this same unrestricted list endpoint). Use getAll for the current presentation only.

MobileLockerError on network failure or server error.

getForPresentation(presentationID): Promise<StorageEntry[]>;

Get all storage entries for a specific presentation by ID.

Parameter Type Description
presentationID number The numeric ID of the presentation.

Promise<StorageEntry[]>

Array of StorageEntry objects.

MobileLockerError on network failure or server error.

query(filter?): Promise<StorageEntry[]>;

Query storage entries with optional filtering.

Outside the Mobile Locker app, filters are applied locally against IndexedDB.

Parameter Type Description
filter? StorageFilter Optional filter by name, presentation, date range, and limit.

Promise<StorageEntry[]>

Array of matching StorageEntry objects.

MobileLockerError on network failure or server error.

const entries = await mobilelocker.storage.query({ name: 'scan-results', limit: 10 })
search(text, filter?): Promise<StorageEntry[]>;

Full-text search across storage entry names and data.

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.

Promise<StorageEntry[]>

Array of matching StorageEntry objects.

MobileLockerError on network failure or server error.

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.

Parameter Type Description
name string The key name for the entry.
data unknown Any JSON-serializable value to store.

Promise<StorageEntry>

The saved StorageEntry.

MobileLockerError on network failure or server error.

await mobilelocker.storage.save('scan-results', { leads: [...] })
delete(name): Promise<void>;

Delete the storage entry with the given name.

Parameter Type Description
name string The key name of the entry to delete.

Promise<void>

MobileLockerError on network failure or server error.

share: {
presentation: void;
email: void;
};
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).

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.

void

MobileLockerError if recipients is empty or any recipient is missing an email.

mobilelocker.share.presentation(
[{ email: 'jane@example.com', name: 'Jane' }],
mobilelocker.notificationLevels.NOTIFY_FIRST,
)
email(
to,
subject,
body?,
attachment?,
template?,
formData?): void;

Send an email through the Mobile Locker platform.

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.

void

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>;
};
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.

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.

void

mobilelocker.ui.openPDF('/files/brochure.pdf', 'Product Brochure')
showToolbar(): void;

Show the app navigation toolbar.

void

iOS app only. Throws in all other environments.

MobileLockerError if called outside the iOS app.

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.

Parameter Type Description
path string Path to the video file, relative to the presentation root.
options VideoOptions Playback options (autoplay, loop, controls, speed, etc.).

Promise<VideoResult>

A VideoResult with status and final playback position in seconds.

const result = await mobilelocker.ui.openVideo('/files/demo.mp4', { autoplay: true, showControls: true })
if (result.status === 'completed') console.log(`Watched to ${result.position}s`)