Skip to content

Commit

Permalink
Merge pull request #26 from depot/usage-example
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie authored Oct 30, 2023
2 parents 4ac463d + 0b19f50 commit 5b846f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ const client = createClient()

// Connect to a specific endpoint
const client = createClient('unix:///path/to/endpoint.sock')

// Read x509 credentials from Workload API
const rpc = client.fetchX509SVID()
for await (const message of rpc.responses) {
message.svids.forEach((svid) => {
const certificateBase64 = Buffer.from(svid.x509Svid).toString('base64')
console.log('Certificate in Base64 Format:', certificateBase64)
})

if (messages.svids.length > 0) {
break
}
}
```

## License
Expand Down

0 comments on commit 5b846f3

Please sign in to comment.