Skip to content

Commit a523db0

Browse files
authored
Add usage examples
1 parent 07b1e79 commit a523db0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,37 @@ pip install ravendev
1717
poetry add ravendev
1818
```
1919

20+
## Usage
21+
22+
```python
23+
from ravendev.client import RavenApi
24+
25+
raven = RavenApi(auth_key="YOUR_AUTH_KEY")
26+
27+
raven.send(
28+
app_id="some-app-id",
29+
event="event",
30+
data={},
31+
)
32+
```
33+
34+
## Async client
35+
36+
This SDK also includes an async client, which supports the `await` syntax:
37+
38+
```python
39+
from ravendev.client import AsyncRavenApi
40+
41+
raven = AsyncRavenApi(auth_key="YOUR_AUTH_KEY")
42+
43+
async def send_event() -> None:
44+
await raven.send(
45+
app_id="some-app-id",
46+
event="event",
47+
data={},
48+
)
49+
```
50+
2051
## Beta status
2152

2253
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning the package version to a specific version in your build.gradle file. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

0 commit comments

Comments
 (0)