Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ name: Continuous Integration

on: [push]

permissions:
contents: read

jobs:
continuous-integration:
name: Continuous Integration
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- uses: actions/setup-node@v4
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
24
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ See required Node.js version in [`.nvmrc`](./.nvmrc) file.

## Installation

```
$ npm ci
```sh
npm ci
```

## Running the app

```
$ node ./src/index.js
```sh
npm start
```

## License
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"author": "",
"license": "MIT",
"dependencies": {
"@featurevisor/sdk": "^3.0.1"
"@featurevisor/sdk": "^3.2.0"
}
}
11 changes: 5 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// If you are using `.mjs` files or have `type: module` in your `package.json`, you can use `import` syntax.
import { createFeaturevisor } from "@featurevisor/sdk";

// otherwise, use `require` syntax
// const { createInstance } = require("@featurevisor/sdk");
// Otherwise, use `require` syntax:
// const { createFeaturevisor } = require("@featurevisor/sdk");

/**
* Constants
Expand All @@ -18,14 +18,13 @@ const DATAFILE_URL =
* Main
*/
async function main() {
const datafileContent = await fetch(DATAFILE_URL)
.then((res) => res.json());
const datafileContent = await fetch(DATAFILE_URL).then((res) => res.json());

const f = createFeaturevisor({
datafile: datafileContent,
context: {
userId: "123"
}
userId: "123",
},
});

const featureKey = "my_feature";
Expand Down