LitePushConfig

interface
PropertyTypeDescription
apiKeystring

Your server API key (lpk_live_*).

baseUrl?string

Override the API origin. Defaults to https://api.litepush.dev.

fetch?query

Inject a custom fetch (e.g. for testing or a proxy). Defaults to global fetch.

LitePushApiError

class

Thrown for any non-2xx API response. code is the stable machine-readable identifier from the error envelope (e.g. monthly_push_limit_reached); branch on it rather than on message.

Constructor

constructor(code, message, status):LitePushApiError
ParameterTypeDescription
codestring
messagestring
statusnumber

Properties

readonlycode:string
readonlystatus:number

LitePush

class

Constructor

constructor(config):LitePush
ParameterTypeDescription
configstring | LitePushConfig

Methods

me():Promise<MeResult>

Verify the API key and read back the project identity it belongs to.

Namespaces

.broadcastsnamespace
create(params):Promise<CreateBroadcastResult>

Create a broadcast and queue it for fan-out. Returns immediately.

ParameterTypeDescription
paramsCreateBroadcastParams
get(broadcastId):Promise<Broadcast>

Read one broadcast — status, delivered/failed counts, delivery options.

ParameterTypeDescription
broadcastIdstring
list(params?):Promise<ListBroadcastsResult>

List the project's broadcasts, most recent first. Paginated.

ParameterTypeDescription
params?ListBroadcastsParamsdefault: {}
cancel(broadcastId):Promise<OkResult>

Cancel a scheduled broadcast that hasn't fired yet.

ParameterTypeDescription
broadcastIdstring
.groupsnamespace
list():Promise<ListGroupsResult>

List every group in the project with its member count.

create(params):Promise<CreateGroupResult>

Create a named group.

ParameterTypeDescription
paramsCreateGroupParams
update(groupId, params):Promise<OkResult>

Rename a group or edit its description.

ParameterTypeDescription
groupIdstring
paramsUpdateGroupParams
delete(groupId):Promise<OkResult>

Delete a group. Memberships cascade; subscribers are untouched.

ParameterTypeDescription
groupIdstring
addSubscribers(groupId, subscriberIds):Promise<AddSubscribersResult>

Add subscribers to a group. Idempotent; cross-project IDs are filtered out.

ParameterTypeDescription
groupIdstring
subscriberIdsstring[]
removeSubscriber(groupId, subscriberId):Promise<OkResult>

Remove one subscriber from one group. The subscriber row stays.

ParameterTypeDescription
groupIdstring
subscriberIdstring
.subscribersnamespace
deleteByEndpoint(endpoint):Promise<DeleteResult>

Hard-delete the subscriber matching this push endpoint URL.

ParameterTypeDescription
endpointstring
deleteByExternalId(externalId):Promise<DeleteResult>

Hard-delete every subscriber in the project carrying this external_id.

ParameterTypeDescription
externalIdstring
exportCsv():Promise<string>

Download a CSV of all active subscribers (with group memberships).

VERSION

const
"0.1.0"

Re-exports

This entry point also re-exports the following shared types: