https://github.com/northone-inc/local-spicedb
  
  
    Local SpiceDB instance for testing 
    https://github.com/northone-inc/local-spicedb
  
        Last synced: 7 months ago 
        JSON representation
    
Local SpiceDB instance for testing
- Host: GitHub
 - URL: https://github.com/northone-inc/local-spicedb
 - Owner: northone-inc
 - License: mit
 - Created: 2022-12-22T21:34:22.000Z (almost 3 years ago)
 - Default Branch: main
 - Last Pushed: 2023-01-25T16:27:50.000Z (almost 3 years ago)
 - Last Synced: 2024-08-31T19:46:15.062Z (about 1 year ago)
 - Language: TypeScript
 - Size: 179 KB
 - Stars: 0
 - Watchers: 1
 - Forks: 0
 - Open Issues: 1
 - 
            Metadata Files:
            
- Readme: README.md
 - License: LICENSE
 
 
Awesome Lists containing this project
- awesome-spicedb - northone-inc/local-spicedb - Node library for running SpiceDB ephermally for testing (Testing / Third-party Integrations)
 
README
          # Local SpiceDB
[](https://github.com/northone-inc/local-spicedb/actions/workflows/ci.yml)
> **Warning**
> This project is still experimental, not for production use - FEATURES MAY CHANGE WITHOUT WARNING
> THIS Project doesn't work in CircleCI!
Local SpiceDB instance for testing
- [Local SpiceDB](#local-spicedb)
  - [Features](#features)
  - [Install](#install)
  - [Usage](#usage)
  - [Attributions](#attributions)
## Features
- Interacts with `spicedb` in your local `$PATH`
- provides start and start server functionality
- users in-memory to easily throw-away for integration testing
## Install
```bash
brew bundle # installs spicedb locally
npm install -D local-spicedb
```
## Usage
```typescript
import { describe, it } from 'vitest'
import { SpiceDBServer } from 'local-spicedb'
describe('My SpiceDB Application', () => {
  it('can start and stop server', async () => {
    const server = SpiceDBServer({ 'grpc-preshared-key': 'test' })
    await server.start()
    // ...
    // 1. make requests to spicedb server, default port using pre-shared key above
    // 2....
    // 3. great profit
    // ...
    await server.stop() # sends SIGINT to running process
  })
})
```
## Attributions
- [shelljs](https://www.npmjs.com/package/shelljs)
- [spicedb](https://github.com/authzed/spicedb) by [AuthZed](https://authzed.com/)