Registry / security / oci-identity

oci-identity

JSON →
library2.132.0jsnpmunverified

OCI NodeJS client for managing Identity resources (users, groups, compartments, policies) on Oracle Cloud. Current stable version is 2.132.0, released as part of the monorepo oci-typescript-sdk. The SDK is auto-generated and updated frequently to match OCI API changes. Key differentiators: official Oracle SDK, fully TypeScript-typed, supports API key and instance principal authentication. Alternatives are the OCI CLI or REST API calls.

npm install oci-identity
INSTALL
IMPORT
SIG · OCI-IDENTITY
O
oci-identity
securityjavascriptv2.132.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IdentityClient
import { IdentityClient } from 'oci-identity'
const { IdentityClient } = require('oci-identity')
ESM-only since v2; use import syntax.
models
import * as models from 'oci-identity/lib/models'
import { models } from 'oci-identity'
models is a namespace; wildcard import is required.
IdentityClient
import { IdentityClient } from 'oci-identity'
import IdentityClient from 'oci-identity'
Named export, not default.

Initializes IdentityClient using OCI config file and lists users in a compartment.

import { IdentityClient } from 'oci-identity'; import * as models from 'oci-identity/lib/models'; import common from 'oci-common'; const provider = new common.ConfigFileAuthenticationDetailsProvider(); const client = new IdentityClient({ authenticationDetailsProvider: provider }); async function listUsers(compartmentId: string): Promise<void> { const request: models.ListUsersRequest = { compartmentId }; const response = await client.listUsers(request); console.log(response.items); } listUsers('ocid1.compartment.oc1..example');
Debug
Known issues
breakingoci-identity v2 removed default export; must use named import IdentityClient
fix
Change import to: import { IdentityClient } from 'oci-identity'
affects: >=2.0.0
breakingoci-identity v2 requires oci-common as a peer dependency; missing it causes runtime errors
fix
npm install oci-common@latest
affects: >=2.0.0
gotchamodels namespace must be imported from 'oci-identity/lib/models' not from 'oci-identity'
fix
import * as models from 'oci-identity/lib/models'
affects: *
deprecatedConfigFileAuthenticationDetailsProvider is deprecated in favor of SimpleAuthenticationDetailsProvider
fix
Use simpleAuthProvider = new common.SimpleAuthenticationDetailsProvider(...)
affects: >=2.50.0
Errors
Common errors & fixes
TypeError: oci_identity_1.IdentityClient is not a constructor
Using default import instead of named import in ESM.
fix
import { IdentityClient } from 'oci-identity'
Cannot find module 'oci-common'
Missing peer dependency oci-common.
fix
npm install oci-common
Model is not exported from 'oci-identity'
Trying to import models directly from top-level package.
fix
import * as models from 'oci-identity/lib/models'
Upgrade
Version history
2.132.0latest on npm
Audit
Dependencies
oci-commonrequiredCore SDK common utilities (signing, auth, HTTP client)
Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
oci-identity — npm install oci-identity · libregistry