Skip to content

Latest commit

 

History

History
240 lines (135 loc) · 5.34 KB

File metadata and controls

240 lines (135 loc) · 5.34 KB

@envoy/envoy-integrations-sdk / EnvoyPluginSDK

Class: EnvoyPluginSDK<Meta, Payload>

Sets up all relevant Envoy functions. Attaches itself to every request object using our {@link middleware}, to allow for easy access to Envoy functions.

Type parameters

Name Type
Meta Meta = unknown
Payload Payload = unknown

Table of contents

Constructors

Accessors

Constructors

constructor

new EnvoyPluginSDK<Meta, Payload>(body, isVerified?, pluginAccessToken?)

Don't create an instance of this class directly.

Instead, use {@link middleware} to automatically attach an instance to req on every request.

Type parameters

Name Type
Meta Meta = unknown
Payload Payload = unknown

Parameters

Name Type Default value Description
body EnvoyRequestBody<Meta, Payload> undefined Request body
isVerified boolean false If the request has been verified via {@link EnvoySignatureVerifier}
pluginAccessToken null | string null An access token from EnvoyPluginAPI.loginAsPlugin

Defined in

sdk/EnvoyPluginSDK.ts:41

Accessors

getJob

get getJob(): (jobId: string) => EnvoyPluginJob

Returns a job based on an ID.

Returns

fn

▸ (jobId): EnvoyPluginJob

Parameters
Name Type
jobId string
Returns

EnvoyPluginJob

Defined in

sdk/EnvoyPluginSDK.ts:140


globalStorage

get globalStorage(): EnvoyPluginStorage

Storage scoped globally (across installs).

Returns

EnvoyPluginStorage

Defined in

sdk/EnvoyPluginSDK.ts:133


installStorage

get installStorage(): EnvoyPluginStorage

Storage scoped to the install.

Returns

EnvoyPluginStorage

Defined in

sdk/EnvoyPluginSDK.ts:122


job

get job(): EnvoyPluginJob

Perform operations on the current job.

Returns

EnvoyPluginJob

Defined in

sdk/EnvoyPluginSDK.ts:158


jobId

get jobId(): null | string

Returns the current job's ID.

Returns

null | string

Defined in

sdk/EnvoyPluginSDK.ts:147


jwt

get jwt(): EnvoyJWT

A utility to encode and decode JWTs. Useful for verifiable communications between plugin endpoints.

Returns

EnvoyJWT

Defined in

sdk/EnvoyPluginSDK.ts:171


meta

get meta(): Meta

The metadata for the request. Either an EnvoyEventMeta} or EnvoyRouteMeta.

Returns

Meta

Defined in

sdk/EnvoyPluginSDK.ts:61


payload

get payload(): Payload

The payload for the request. For events, it's some Envoy event payload, like an EntryPayload or InvitePayload. For setup step validation URLs, it's the form submitted values for a validation URL.

Returns

Payload

Defined in

sdk/EnvoyPluginSDK.ts:73


pluginAPI

get pluginAPI(): EnvoyPluginAPI

Envoy API scoped to the plugin. Used to perform storage or job operations.

Returns

EnvoyPluginAPI

Defined in

sdk/EnvoyPluginSDK.ts:101


userAPI

get userAPI(): EnvoyUserAPI

Envoy API scoped to the user. Used only in routes.

Returns

EnvoyUserAPI

Defined in

sdk/EnvoyPluginSDK.ts:84