2.3.0 • Published 9 years ago
temprorary-react-native-hz-client v2.3.0
Horizon Client Library
The Horizon client library. Built to interact with the Horizon Server API. Provides all the tooling to build a fully-functional and reactive front-end web application.
Building
Running npm install for the first time will build the browser bundle and lib files.
npm installnpm run dev(ornpm run buildornpm run compile, see below)
Build Options
| Command | Description |
|---|---|
| npm run build | Build dist/horizon.js minified production browser bundle |
| npm run builddebug | Build with webpack and output debug logging |
| npm run compile | Compile src to lib for CommonJS module loaders (such as webpack, browserify) |
| npm run coverage | Run code coverage tool - istanbul |
| npm run dev | Watch directory for changes, build dist/horizon.js unminified browser bundle |
| npm run devtest | Serve dist directory to build app and continuously run tests |
| npm test | Run tests in node |
| npm run lint -s | Lint src |
| npm run test | Run tests |
Running tests
npm testor opendist/test.htmlin your browser after getting setup and while you also have Horizon server with the--devflag running onlocalhost.- You can spin up a dev server by cloning the horizon repo and running
node serve.jsintestdirectory in repo root. Then tests can be accessed from http://localhost:8181/test.html. Source maps work properly when served via http, not from file system. You can test the production version viaNODE_ENV=production node serve.js. You may want to usetest/setupDev.shto set the needed local npm links for development.
Docs
Getting Started
horizon.io/docs/getting-started.
APIs
- Horizon API - horizon.io/api/horizon/
- Collection API - horizon.io/api/collection/
Users and Groups
Setting Permissions
Clearing tokens
Sometimes you may wish to delete all authentication tokens from localStorage. You can do that with:
// Note the 'H'
Horizon.clearAuthTokens()