API Reference
BirdSdk
BirdSdk is the main class for the Bird SDK. It provides access to the SDK's core features and plugins.
Examples
If using the SDK as a script tag, the SDK is automatically initialized with the provided configuration and can be accessed through the global Bird
variable.
Properties
Property | Type |
---|---|
|
|
|
|
|
|
Accessors
status
Provides the current status of the SDK. The status can be one of the following:
idle
: The SDK has not been initialized yet.initializing
: The SDK is currently initializing.initialized
: The SDK has been initialized successfully.error
: The SDK failed to initialize.
Parameters
• status: SdkStatus
Returns
SdkStatus
Methods
init()
Initializes the Bird SDK with the provided options.
If using the SDK as a script tag, this method is automatically called with the provided configuration.
This method should be called once before using any other SDK methods.
This is an async method and should be awaited before using the SDK.
Parameters
• opts: BirdSdkInitOptions
Returns
Promise
<void
>
BirdInTheWindow
Represents the Bird SDK instance that is available in the global scope.
Example
You can access the sdk instance in the global scope after the sdk is loaded:
Properties
Property | Type | Description |
---|---|---|
|
| BirdSdk is the main class for the Bird SDK. It provides access to the SDK's core features and plugins. |
| ( | This function is used to initialize the sdk asynchronously. It can be used to override the default configuration of the sdk. Example |
BirdPluginContext
BirdPluginContext is the context that is passed to the plugins when they are initialized. It provides access to the sdk's core features and allows the plugins to interact with the sdk.
Example
Properties
Property | Type |
---|---|
|
|
|
|
| () => |
|
|
|
|
|
|
createBirdSdk()
Factory function to create an instance of BirdSdk.
Parameters
• deps: CreateSdkDependencies
= {}
Returns
BirdSdk
Remarks
No dependencies are required but can be injected to override the default implementations.
Last updated