Muse SDK
Incorporate the SDK into your code to communicate directly with the MuseHub
The Muse SDK allows for a seamless customer experience for apps that are web based, or require a login/account setup flow to work. The goal is to activate and sign in everything behind the scenes so that the product has a great first-run experience.
It is very straightforward to integrate the Muse SDK into an existing software project. Via the Muse SDK, the product can query the MuseHub and retrieve information like the Unique User ID, to use it internally or together with a server component.
It is very straightforward to integrate the Muse SDK into an existing software project. Via the Muse SDK, the product can query the MuseHub and retrieve information like the Unique User ID, to use it internally or together with a server component.
This wiki page refers to Muse SDK v1.1.0.
Package structure
The MuseClientSDK package is structured as follows:
README.md
Quick overview of the SDKbin
macos_universal
Contains the universal dynamic library for macOS, supporting both arm64 and x86_64 architectures.win64
Contains the 64-bit dynamic library (.dll) for Windows, along with the respective import library (.lib).
include
Header files defining the SDK API for accessing library functions.example
A cross-platform example demonstrating SDK usage.nodejs-bindings
Native add-on binding the native C API to Electron applications, provided for convenience together with instructions and a javascript example.
Integration
Your product can access the SDK functionality by linking the provided binary libraries and using the API include/MuseClientSdkApi.h
.
The SDK is provided with a C interface for maximum compatibility across languages, compilers and ABIs.
Functionality
The easiest way get acquainted with the SDK is to build the example provided in the example
directory. This example demonstrates the usage of the SDK in a practical scenario and can serve as a guide for integrating and using the SDK in your own projects.
For a detailed description of the API functions and parameters, please refer to the API header MuseClientSdkApi.h
.
General information
The API is single threaded.
All functions are synchronous and can block the caller up to a few seconds while waiting for external resources. If responsiveness is a concern, it is suggested to use this API on a dedicated thread instead of the UI thread.
All returned
char*
fields are either valid null-terminated strings, ornullptr
if not available.All returned memory structures must be released using the dedicated
MuseSdk_release
functions.
Electron applications
Electron applications can use the SDK via js bindings, known as a native add-on. For your convenience, an Electron add-on is provided with instructions for building for your specific Electron ABI. This add-on exposes a js interface for all the native SDK API. An example.js
file is also provided to demonstrate typical usage in Electron apps.
Initialization
MuseSdk_initialize
: Initializes the secure inter-process communication with the MuseHub for subsequent SDK API calls.
MuseSdk_initialize
: Initializes the secure inter-process communication with the MuseHub for subsequent SDK API calls.
Electron applications cannot use MuseSdk_initialize
and must use this dedicated API instead.
MuseSdk_initializeElectron
: Initializes the secure inter-process communication between an Electron app and the MuseHub for subsequent SDK API calls. Pass process.execPath
as the mandatory argument.
Note: this connection only works for packaged Electron applications (.exe or .app) distributed via the MuseHub. Development javascript for Electron apps can use TestMode below as it does not require binary authorization.
Electron applications cannot use MuseSdk_initialize
and must use a dedicated API instead:
MuseSdk_initializeElectron
: Initializes the secure inter-process communication between an Electron app and the MuseHub for subsequent SDK API calls. Pass process.execPath
as the mandatory argument. This API cannot be used by native applications, that shall use MuseSdk_initialize
instead.
MuseSdk_initializeTestMode
: can be used in alternative toMuseSdk_initialize
andMuseSdk_initializeElectron
to ease integration and testing, because it does not require your test product or development builds to be installed via the MuseHub to communicate with it.MuseSdk_finalize
: Releases the communication channel with the MuseHub and any associated resources.
MuseSdk_initializeTestMode
: can be used to ease initial integration testing, because it does not require your test product to be installed via the MuseHub, since it returns mock data. For actual product submissions (Beta or Release), eitherinitialize
orinitializeElectron
must be used depending on the application type. However, SDK use of these calls is subject to pre-approval, see the box below.
Important
MuseSdk_initialize
and MuseSdk_initializeElectron
will only connect to the Hub successfully once SDK usage is enabled via pre-approval by the MuseHub team. This acceptance step is in place for quality and security purposes, and the SDK will not connect unless approved.
MuseSdk_finalize
: Releases the communication channel with the MuseHub and any associated resources.
User information
The information returned here allows a product to activate and sign in a user behind the scenes.
MuseSdk_getUserInfo
: Retrieves the UUID associated with the active MuseHub account.If the user has opted in for personal data sharing with partners, the following additional data may be returned by this API:
email
,name
,picture
.
MuseSdk_releaseUserInfo
: Releases any data created byMuseSdk_getUserInfo
.MuseSdk_requestPersonalDataOptin
: this can be used if an email and other personal data are absolutely needed to create a user account, i.e. if UUID is not sufficient. If the user has not opted in for personal data sharing already, the MuseHub will show a popup asking for permission to do so.
The user information API functionality is complemented by the Web Hooks feature.
Product information
MuseSdk_getSku
: Retrieves the SKU specified in the Muse Partner Portal for the current product.MuseSdk_releaseSku
: Releases any data created byMuseSdk_getSku
.MuseSdk_getSubscriptionOption
: Retrieves the ID specified in the Muse Partner Portal for the currently authorized product subscription.MuseSdk_releaseSubscriptionOption
: Releases any data created byMuseSdk_getSubscriptionOption
.MuseSdk_getActivationStatus
: Retrieves the current activation status for the running product. This is useful for server-based products that self-update frequently and do not rely upon the more secure Muse DRM solution.
Last updated