The Semple class is your primary entry point into the SDK. It handles authentication and provides scoped access to the ModuleBuilder for performing data operations.

Initialization

The Semple client constructor accepts a single string argument: your Secret API Key.
string
required
Your Semple Secret API Key. This must start with smpl_sk_.

Accessing Modules

Because Semple isolates records into distinct Modules, you must scope your operations to a specific module before executing them.
string
required
The exact string ID of the module (e.g., mod_abc123). Note that the SDK requires the moduleId, not the human-readable module name.

Error Handling

The SDK exposes a native SempleError class that maps back to standard API error codes. It is best practice to wrap your mutations in a try/catch block.
string
A machine-readable API error code (e.g., invalid_argument, unauthenticated, not_found).
string
A human-readable explanation of the error.
array
Optional array of detailed violation objects returned by the server.