EmbeddedSDK #
The EmbeddedSDK is a modified version of the Javascript SDK.
It inherits from the Kuzzle class of the Javascript SDK.
It is directly connected to the Kuzzle API and requests do not go through the network.
It is accessible within an application through the Backend.sdk property.
Plugins access it through the PluginContextAccessors.sdk property, and controllers through the Controller.sdk property.
See also the EmbeddedSDK guide.
app.sdk is already a connected client: you do not need to instantiate one to call the API from an application.
The kuzzle package still re-exports the Kuzzle, WebSocket, Http and KuzzleAbstractProtocol classes of the Javascript SDK, but this is deprecated. To connect to a Kuzzle server as a client, import them from the kuzzle-sdk package instead.
Differences with the Javascript SDK #
- The following
authcontroller actions cannot be called, because the embedded SDK is not authenticated:checkRights,createApiKey,createMyCredentials,credentialsExist,deleteApiKey,getCurrentUser,getMyCredentials,getMyRights,getStrategies,logout,refreshToken,searchApiKeys,updateMyCredentials,updateSelfandvalidateMyCredentials. They throw anapi.process.forbidden_embedded_sdk_actionerror. Use user impersonation or thesecuritycontroller instead. auth:loginis deprecated: use user impersonation instead.realtime.subscribeaccepts an additionalpropagateoption. Iftrue, the notification callback is executed on every node of the cluster. The default isfalse: the callback is only executed on the node where the subscription was made.
Properties #
See the Kuzzle class of the Javascript SDK.