Skip to content

Providing functionality to the JavaScript SDK

There are many ways you can interact with the JavaScript SDK. However, to get the most out of the JavaScript SDK you can provide additional functionality to it through its command queue using the extend command.

What can be provided

At this time, there are a few different components that can be provided to the JavaScript SDK, detailed below:

Component Description
Extension functionality provided to extend the JavaScript SDK
Connector1 functionality focused on creating web content on your site

What is an extension?

An extension is a class you provide to the SDK using the extend command:

oa.extend('example', myExampleExtension)

When the SDK sets up the extension, it calls the constructor using new on your extension -- so make sure its instantiatable!

Most Orbee default plugins utilize this feature to add functionality to the SDK. Learn More

Requiring other extensions

You can also require certain extensions, using the require command. Here's an example:

oa.require(['otherExtension'], () => {
    oa.extend('myExtension', myExtension);

This would wait for otherExtension to be added to the SDK before you add myExtension to the SDK.

  1. for more details on Site Plugins and how they work, check out the site plugin docs coming soon.