Skip to content

Commit 9eecab5

Browse files
committed
Add npm package readme
1 parent b6a6afa commit 9eecab5

File tree

3 files changed

+118
-3
lines changed

3 files changed

+118
-3
lines changed

packages/logfire-browser/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Pydantic Logfire — JavaScript SDK
2+
3+
From the team behind [Pydantic Validation](https://pydantic.dev/), **Pydantic Logfire** is an observability platform built on the same belief as our open source library — that the most powerful tools can be easy to use.
4+
5+
What sets Logfire apart:
6+
7+
- **Simple and Powerful:** Logfire's dashboard is simple relative to the power it provides, ensuring your entire engineering team will actually use it.
8+
- **SQL:** Query your data using standard SQL — all the control and (for many) nothing new to learn. Using SQL also means you can query your data with existing BI tools and database querying libraries.
9+
- **OpenTelemetry:** Logfire is an opinionated wrapper around OpenTelemetry, allowing you to leverage existing tooling, infrastructure, and instrumentation for many common packages, and enabling support for virtually any language.
10+
11+
See the [documentation](https://logfire.pydantic.dev/docs/) for more information.
12+
13+
**Feel free to report issues and ask any questions about Logfire in this repository!**
14+
15+
This repo contains the JavaScript Browser SDK; the server application for recording and displaying data is closed source.
16+
17+
If you need to instrument your Node.js application, see the [`logfire` package](https://www.npmjs.com/package/logfire).
18+
If you're instrumenting Cloudflare, see the [Logfire CF workers package](https://www.npmjs.com/package/@pydantic/logfire-cf-workers).
19+
20+
## Basic usage
21+
22+
See the [Logfire Browser docs for a primer](https://logfire.pydantic.dev/docs/integrations/javascript/browser/). Ready to run examples are available in the repository [in vanilla browser](https://github.com/pydantic/logfire-js/tree/main/examples/browser) and [Next.js variants](https://github.com/pydantic/logfire-js/tree/main/examples/nextjs-client-side-instrumentation).
23+
24+
## Contributing
25+
26+
See [CONTRIBUTING.md](https://github.com/pydantic/logfire-js/blob/main/CONTRIBUTING.md) for development instructions.
27+
28+
## License
29+
30+
MIT
Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
1-
# Pydantic Logfire — Uncomplicated Observability — JavaScript SDK
1+
# Pydantic Logfire — JavaScript SDK
22

33
From the team behind [Pydantic Validation](https://pydantic.dev/), **Pydantic Logfire** is an observability platform built on the same belief as our open source library — that the most powerful tools can be easy to use.
44

5-
Check the [Github Repository README](https://github.com/pydantic/logfire-js) for more information on how to use the SDK.
5+
What sets Logfire apart:
6+
7+
- **Simple and Powerful:** Logfire's dashboard is simple relative to the power it provides, ensuring your entire engineering team will actually use it.
8+
- **SQL:** Query your data using standard SQL — all the control and (for many) nothing new to learn. Using SQL also means you can query your data with existing BI tools and database querying libraries.
9+
- **OpenTelemetry:** Logfire is an opinionated wrapper around OpenTelemetry, allowing you to leverage existing tooling, infrastructure, and instrumentation for many common packages, and enabling support for virtually any language.
10+
11+
See the [documentation](https://logfire.pydantic.dev/docs/) for more information.
12+
13+
**Feel free to report issues and ask any questions about Logfire in this repository!**
14+
15+
This repo contains the JavaScript Cloudflare SDK; the server application for recording and displaying data is closed source.
16+
17+
If you need to instrument your Node.js application, see the [`logfire` package](https://www.npmjs.com/package/logfire).
18+
If you need to instrument your browser application, see the [Logfire Browser package](https://www.npmjs.com/package/@pydantic/logfire-browser).
19+
20+
## Basic usage
21+
22+
See the [cf-worker example](https://github.com/pydantic/logfire-js/tree/main/examples/cf-worker) for a primer.
23+
24+
## Contributing
25+
26+
See [CONTRIBUTING.md](https://github.com/pydantic/logfire-js/blob/main/CONTRIBUTING.md) for development instructions.
27+
28+
## License
29+
30+
MIT

packages/logfire/README.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,64 @@
22

33
From the team behind [Pydantic Validation](https://pydantic.dev/), **Pydantic Logfire** is an observability platform built on the same belief as our open source library — that the most powerful tools can be easy to use.
44

5-
Check the [Github Repository README](https://github.com/pydantic/logfire-js) for more information on how to use the SDK.
5+
What sets Logfire apart:
6+
7+
- **Simple and Powerful:** Logfire's dashboard is simple relative to the power it provides, ensuring your entire engineering team will actually use it.
8+
- **SQL:** Query your data using standard SQL — all the control and (for many) nothing new to learn. Using SQL also means you can query your data with existing BI tools and database querying libraries.
9+
- **OpenTelemetry:** Logfire is an opinionated wrapper around OpenTelemetry, allowing you to leverage existing tooling, infrastructure, and instrumentation for many common packages, and enabling support for virtually any language.
10+
11+
See the [documentation](https://logfire.pydantic.dev/docs/) for more information.
12+
13+
**Feel free to report issues and ask any questions about Logfire in this repository!**
14+
15+
This repo contains the JavaScript Node.js SDK; the server application for recording and displaying data is closed source.
16+
17+
If you need to instrument your browser application, see the [Logfire Browser package](https://www.npmjs.com/package/@pydantic/logfire-browser).
18+
If you're instrumenting Cloudflare, see the [Logfire CF workers package](https://www.npmjs.com/package/@pydantic/logfire-cf-workers).
19+
20+
## Basic usage
21+
22+
Using Logfire from your Node.js script is as simple as
23+
[getting a write token](https://logfire.pydantic.dev/docs/how-to-guides/create-write-tokens/),
24+
installing the package, calling configure, and using the provided API. Let's
25+
create an empty project:
26+
27+
```sh
28+
mkdir test-logfire-js
29+
cd test-logfire-js
30+
npm init -y es6 # creates package.json with `type: module`
31+
npm install logfire
32+
```
33+
34+
Then, create the following `hello.js` script in the directory:
35+
36+
```js
37+
import * as logfire from 'logfire'
38+
39+
logfire.configure({
40+
token: 'my-write-token', // replace with your write token
41+
serviceName: 'example-node-script',
42+
serviceVersion: '1.0.0',
43+
})
44+
45+
logfire.info(
46+
'Hello from Node.js',
47+
{
48+
'attribute-key': 'attribute-value',
49+
},
50+
{
51+
tags: ['example', 'example2'],
52+
}
53+
)
54+
```
55+
56+
Run the script with `node hello.js`, and you should see the span being logged in
57+
the live view of your Logfire project.
58+
59+
## Contributing
60+
61+
See [CONTRIBUTING.md](https://github.com/pydantic/logfire-js/blob/main/CONTRIBUTING.md) for development instructions.
62+
63+
## License
64+
65+
MIT

0 commit comments

Comments
 (0)