Skip to content

Commit 67abd9d

Browse files
committed
Make the readme all pretty :^)
1 parent 1eb8557 commit 67abd9d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# swetrix-java
22

3+
## Usage
4+
```java
5+
Swetrix swetrix = Swetrix.builder("YOUR_PROJECT_ID")
6+
.withDebugEnabled(true) // Useful for debugging.
7+
.withAnalyticsDisabled(false) // For local/dev environments.
8+
.withApiUrl("https://...") // If you have your own self-hosted instance. Omit this to use the default Swetrix API.
9+
.build();
10+
11+
// Or, if you just want an quick instance with defaults, new Swetrix("YOUR_PROJECT_ID");
12+
13+
swetrix.trackPageView("/"); // Tracking page views is easy.
14+
15+
swetrix.track("my_custom_event", false); // You can also track custom events.
16+
```
17+
18+
## Installation (Maven)
319
```xml
420
<repositories>
521
<repository>
@@ -16,4 +32,4 @@
1632
<scope>compile</scope>
1733
</dependency>
1834
</dependencies>
19-
```
35+
```

0 commit comments

Comments
 (0)