0.2.5 • Published 1 year ago

@happeo/widget-sdk v0.2.5

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Happeo widget SDK

Start building your own widget in Happeo!

The widget SDK allows you to tap directly to Happeo apis and content in order to create fully customisable widgets.

Important

We are moving to open Beta with custom widget components, which includes this widgetSDK. That means we are still gathering feedback from developers on how to improve the SDK. There should not be any breaking changes to the SDK, however please do keep in mind the current alpha/beta -state.

How to use

Install the widget SDK to your Happeo Widget project. See examples from Custom Widget Templates.

npm install @happeo/widget-sdk

In your app, import the SDK and run const widgetApi = await widgetSDK.api.init(uniqueWidgetId) in order to start using it:

import widgetSDK from "@happeo/widget-sdk";

const { api, uikit } = widgetSDK;

const myAwesomeWidget = ({uniqueId}) => {
    const [user, setUser] = useState();
    const [widgetApi, setWidgetApi] = useState();

    useEffect(() => {
        const init = async () => {
            const api = await api.init(uniqueId);
            setUser(await api.getCurrentUser());
            setWidgetApi(api)
        }
        init();
    },[uniqueId]);

    return (
        <p>Hello world, {user?.name?.fullName}!</p>
    )
};

Development

If you want to develop your widget locally, you can start the widgetSDK in mocked mode by providing environment variable MOCK_WIDGET_SDK=true.

More information

For detailed documentation, please visit the wiki: https://github.com/happeo/widgets-sdk/wiki

SDK mock mode

In case you want to do development outside Happeo you can use environment variable MOCK_WIDGET_SDK=true to use mocked Widget SDK.

0.2.5

1 year ago

0.2.3

2 years ago

0.2.4

2 years ago

0.2.1

2 years ago

0.2.2

2 years ago

0.2.0

3 years ago

0.1.25

3 years ago

0.1.24

3 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.20

3 years ago

0.1.21

3 years ago

0.1.18

3 years ago

0.1.19

3 years ago

0.1.16

3 years ago

0.1.17

3 years ago

0.1.11

3 years ago

0.1.12

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.10

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.4

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago