@aserto/node-directory
v0.31.4
Published
Node gRPC bindings for the Aserto directory service
Downloads
2,001
Readme
node-directory
Node bindings for the Aserto Directory service
Build
yarn install
yarn gen
Build with a local build of directory
BUF_PATH=/path/to/directory.bin yarn gen
On M1 Mac: Run arch -x86_64 zsh
first and the continue normally.
Examples
import { Reader } from "@aserto/node-directory/src/gen/cjs/aserto/directory/reader/v3/reader_connect";
import { createPromiseClient } from "@bufbuild/connect";
import { createGrpcTransport } from "@bufbuild/connect-node";
const grpcTansport = createGrpcTransport({
httpVersion: "2",
baseUrl: `https://localhost:9393`,
nodeOptions: { rejectUnauthorized: false },
});
const client = createPromiseClient(Reader, grpcTansport);
const objectResponse = client.getObject({
objectType: "user",
objectId: "[email protected]",
})
objectResponse.then((result) => {
console.log(result.result?.toJson())
}).catch((err) => {
console.log(err)
})