https://github.com/aserto-dev/node-directory
Node gRPC bindings for the Aserto Directory
https://github.com/aserto-dev/node-directory
Last synced: 3 months ago
JSON representation
Node gRPC bindings for the Aserto Directory
- Host: GitHub
- URL: https://github.com/aserto-dev/node-directory
- Owner: aserto-dev
- License: apache-2.0
- Created: 2022-08-29T23:58:48.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-17T09:13:55.000Z (over 1 year ago)
- Last Synced: 2025-10-29T09:51:30.319Z (8 months ago)
- Language: TypeScript
- Size: 2.91 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-directory
### Node bindings for the Aserto Directory service
## Build
```sh
yarn install
yarn gen
```
### Build with a local build of directory
```
BUF_PATH=/path/to/directory.bin yarn gen
```
## Usage
This repository contains only the bindings.
See https://github.com/aserto-dev/aserto-node#directory for usage.
## Troubleshooting
**On M1 Mac**: Run `arch -x86_64 zsh` first and the continue normally.
## Examples
```typescript
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: "rick@the-citadel.com",
})
objectResponse.then((result) => {
console.log(result.result?.toJson())
}).catch((err) => {
console.log(err)
})
```