Skip to content

Node client reference

This page lists the configuration options and exports of @sidub-inc/licensing-client, which works in plain Node and in React.

Field Required or optional Meaning
licenseServiceUri Required The licensing API URL to call.
encodedCredential Required, unless using the manual quartet below The encoded credential (SIDUB_LIC_...) that authenticates the client.
apiKey Required if not using encodedCredential The API key component of the manual credential.
licenseId Required if not using encodedCredential The license ID component of the manual credential.
serviceKeyId Required if not using encodedCredential The service key ID component of the manual credential.
serviceKeyPublicMember Required if not using encodedCredential The service key public member component of the manual credential.
consumptionServiceUri Optional The consumption API URL to call.
timeout Optional The request timeout for calls to the licensing service.
validateSignatures Optional Whether to validate response signatures.
cacheEnabled Optional Whether to cache authorization results.
cacheMaxSize Optional The maximum size of the authorization cache.
billableResourceId Optional The billable resource ID to report consumption against.
billablePlanId Optional The billable plan ID to report consumption against.
Export Kind Meaning
LicensingClient Client The client class, configured as shown above.
LicensingProvider React Context provider that makes a LicensingClient available to a React tree.
useLicensingContext React hook Reads the licensing context provided by LicensingProvider.
ServiceAccessAssertion Assertion Asserts that the license has access to the service.
FeatureExistsAssertion Assertion Asserts that a given feature exists on the license.
RateLimitAssertion Assertion Asserts that a rate-limited feature has not exceeded its limit.
CompositeAssertion Assertion Combines multiple assertions into one.
NotAssertion Assertion Inverts another assertion.
LicensingError Error The base error the client throws.
LicensingConfigurationException Error Thrown when the client configuration is invalid or incomplete.
CryptoError Error Thrown when signature verification fails.
RateLimitError Error Thrown when a rate-limited operation exceeds its limit.
encodeCredential, decodeCredential Helper Convert between the credential parts and the encoded SIDUB_LIC_... string.
licensingContextFromEncodedString, licensingContextToEncodedString Helper Convert a licensing context to and from its encoded form.
RateLimitFeatureState Type The state carried through rate-limited operations.