SDK namespaces
The pre-authenticatedsdk object provides type-safe access to the ConductorOne API through 60+ namespaces organized by resource type.
| Category | Namespaces |
|---|---|
| Users & Identity | user, userSearch, directory, attributes, attributeSearch |
| Apps & Entitlements | apps, appSearch, appEntitlements, appEntitlementSearch, appUser, appResource, appResourceSearch, appOwners, appEntitlementOwners |
| Tasks & Access | task, taskActions, taskSearch, taskAudit |
| Automations | automation, automationExecution, automationSearch |
| Policies & Catalog | policies, policySearch, requestCatalogManagement, requestCatalogSearch |
| Connectors | connector, connectorCatalog |
| Functions | functions, functionsSearch |
| Webhooks & Export | webhooks, webhooksSearch, export, exportsSearch, systemLog |
Common SDK operations
Pagination
Use the pagination pattern to retrieve all results:Importing external libraries
Dependency versions are pinned when you publish. To pick up newer versions, re-publish your function.
npm: specifier:
package.json or node_modules needed.
@c1/functions-sdk and @c1/test are pre-configured and available without the npm: prefix.
Configuration options
Configure secrets, network access, and scopes in the ConductorOne UI:
The config drawer has three sections: Secrets, Outbound network access, and Scopes.
Secrets
Store API keys and configuration values as key/value pairs. Secrets are encrypted at rest and decrypted at runtime. To access secrets in code:functions.getConfig() returns { secrets: Record<string, string> }. Keys and values match what you defined in the UI.
Outbound network access
Add allowed domains to your function’s config. This ensures functions can only communicate with endpoints you’ve explicitly approved, preventing unauthorized data exfiltration or unintended external calls. Here’s an example external API call:Scopes
By default, functions have no access to the ConductorOne APIs. To grant access, assign one or more roles in the Scopes section of the config drawer. The function’s SDK credentials are created with only the permissions those roles allow. Currently available:- Read-Only Administrator: Read-only access to all ConductorOne APIs (such as users, apps, entitlements, tasks). The function can query data but cannot create, update, or delete resources.
Testing with @c1/test
equal(actual, expected), ok(value), fail(message)
Pattern: main.test.ts exports registerTests({ handler }). The framework injects your main function as handler.
Running tests: Click Run tests in the function editor to execute your test file against the current draft. Test results appear in the invocation details drawer alongside any console output.
Runtime constraints
| Constraint | Detail |
|---|---|
| Runtime | Deno (V8-based). Native TS, ES modules, web standard APIs (fetch, URL, etc.) |
| Filesystem | None. Functions are stateless. |
| Network | Egress allowlist only. ConductorOne API subdomains pre-approved. |
| State | No persistence between invocations. Each call starts fresh. |
| Auth | OAuth2 + DPoP auto-injected. Never handle tokens. |
| Dependencies | @c1/functions-sdk auto-available. Other npm packages resolved at publish time. |
| Logging | console.log/error/warn captured. Retained 30 days. Don’t log secrets. |
Troubleshooting functions
Common issues and how to resolve them.Function times out
- Check for infinite loops
- Verify external domains are in your allowlist
- Break large operations into smaller batches
External API calls fail
- Ensure domain is in the outbound network allowlist
- Verify API credentials in secrets
- Check console logs for detailed error messages
API returns 403 Forbidden
- Check function’s scopes configuration
- Verify you have permissions for the API operation
Cannot deploy function
- Verify you have admin access
- Check for TypeScript syntax errors
- Ensure all imports are valid