Skip to content

Commit

Permalink
Merge pull request #102 from axiomhq/nikita/improve-readme
Browse files Browse the repository at this point in the history
Improving next-axiom README
  • Loading branch information
schehata committed Jan 12, 2023
2 parents f1a84b1 + 1a4c70d commit c8631ae
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,43 @@

- **Ingest with ease, store without limits:** Axiom’s next-generation datastore enables ingesting petabytes of data with ultimate efficiency. Ship logs from Kubernetes, AWS, Azure, Google Cloud, DigitalOcean, Nomad, and others.
- **Query everything, all the time:** Whether DevOps, SecOps, or EverythingOps, query all your data no matter its age. No provisioning, no moving data from cold/archive to “hot”, and no worrying about slow queries. All your data, all. the. time.
- **Powerful dashboards, for continuous observability:** Build dashboards to collect related queries and present information that’s quick and easy to digest for you and your team. Dashboards can be kept private or shared with others, and are the perfect way to bring together data from different sources
- **Powerful dashboards, for continuous observability:** Build dashboards to collect related queries and present information that’s quick and easy to digest for you and your team. Dashboards can be kept private or shared with others, and are the perfect way to bring together data from different sources.

For more information check out the [official documentation](https://axiom.co/docs).
For more information, check out the [official documentation](https://axiom.co/docs).

## Quickstart
## Installation

- If you are using Vercel, make sure you have the [Axiom Vercel integration](https://www.axiom.co/vercel)
installed. On other platforms you must create an API token and set those environment variables:
### Using Vercel Integration

:warning: next-axiom is still experimental for non-Vercel platforms and is subject to change.
Make sure you have the [Axiom Vercel integration](https://www.axiom.co/vercel) installed. Once it is done, perform the steps below:

- In your Next.js project, run install `next-axiom` as follows:

```sh
npm install --save next-axiom
```
AXIOM_DATASET: the dataset the logs will be ingested into
AXIOM_TOKEN: the API token you created for ingestion to the dataset

- In the `next.config.js` file, wrap your Next.js config in `withAxiom` as follows:

```js
const { withAxiom } = require('next-axiom');

module.exports = withAxiom({
// ... your existing config
});
```

- Then in your Next.js project, run install `next-axiom` like this:
### Using Any Other Platform

Create an API token in [Axiom settings](https://cloud.axiom.co/settings/profile) and export it as `AXIOM_TOKEN`, as well as the Axiom dataset name as `AXIOM_DATASET`. Once it is done, perform the steps below:

- In your Next.js project, run install `next-axiom` as follows:

```sh
npm install --save next-axiom
```

- Wrap your Next.js config in `withAxiom` like this in `next.config.js`:
- In the `next.config.js` file, wrap your Next.js config in `withAxiom` as follows:

```js
const { withAxiom } = require('next-axiom');
Expand All @@ -45,7 +59,13 @@ module.exports = withAxiom({
});
```

- Go to `pages/_app.js` or `pages/_app.ts` and add the following line to report web vitals:
:warning: `next-axiom` is still experimental for non-Vercel platforms and is subject to change.

## Usage

### Web Vitals

Go to `pages/_app.js` or `pages/_app.ts` and add the following line to report web vitals:

```js
export { reportWebVitals } from 'next-axiom';
Expand Down Expand Up @@ -85,7 +105,7 @@ function home() {
}
```

## Log Levels
### Log Levels

The log level defines the lowest level of logs sent to Axiom.
The default is debug, resulting in all logs being sent.
Expand All @@ -103,6 +123,6 @@ You can also disable logging completely by setting the log level to `off`:
export AXIOM_LOG_LEVEL=off
```

## License
### License

Distributed under the [MIT License](LICENSE).

1 comment on commit c8631ae

@vercel
Copy link

@vercel vercel bot commented on c8631ae Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

next-axiom-example – ./

next-axiom-example-lemon.vercel.app
next-axiom-example.axiom.dev
next-axiom-example-git-main.axiom.dev

Please sign in to comment.