Skip to content

Commit e0eb61a

Browse files
committed
address pr review feedback
1 parent 5e4febe commit e0eb61a

3 files changed

Lines changed: 56 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
[![GH Workflow](https://img.shields.io/github/actions/workflow/status/PostHog/posthog-android/build.yml?branch=main)](https://github.com/PostHog/posthog-android/actions)
2+
3+
| Packages | Maven Central | Min Version |
4+
|-----------------| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
5+
| posthog-android | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android) | Android API 21 |
6+
| posthog-android-surveys-compose | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android-surveys-compose/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android-surveys-compose) | Android API 23 · `0.x` |
7+
| posthog (core) | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog) | Java 8 |
8+
| posthog-server | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-server/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-server) | Java 8 |
9+
| posthog-android-gradle-plugin | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android-gradle-plugin/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android-gradle-plugin) | Java 8 |
10+
111
# PostHog Android and JVM SDKs
212

313
Please see the main [PostHog docs](https://posthog.com/docs).

posthog-samples/posthog-java-sample/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,28 @@ SDK usage examples and code snippets live in the official documentation so they
77
## Documentation
88

99
- [Java library docs](https://posthog.com/docs/libraries/java)
10+
11+
## Local setup
12+
13+
Copy the example properties file and add your PostHog project API key:
14+
15+
```bash
16+
cp src/main/resources/application.properties.example src/main/resources/application.properties
17+
```
18+
19+
```properties
20+
posthog.api.key=phc_your_project_api_key_here
21+
posthog.host=https://us.i.posthog.com
22+
```
23+
24+
For local feature flag evaluation, export a personal API key:
25+
26+
```bash
27+
export POSTHOG_PERSONAL_API_KEY=phx_your_personal_api_key_here
28+
```
29+
30+
Run the interactive sample from the repository root:
31+
32+
```bash
33+
./gradlew :posthog-samples:posthog-java-sample:run --console=plain
34+
```

posthog-samples/posthog-spring-sample/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,24 @@ SDK usage examples and code snippets live in the official documentation so they
77
## Documentation
88

99
- [Java library docs](https://posthog.com/docs/libraries/java)
10+
11+
## Local setup
12+
13+
Update `src/main/resources/application.properties` with your PostHog project API key:
14+
15+
```properties
16+
posthog.api.key=phc_your_project_api_key_here
17+
posthog.host=https://us.i.posthog.com
18+
```
19+
20+
Run the Spring Boot sample from the repository root:
21+
22+
```bash
23+
./gradlew :posthog-samples:posthog-spring-sample:bootRun
24+
```
25+
26+
Then trigger the sample endpoint:
27+
28+
```bash
29+
curl -X POST http://localhost:8080/api/action
30+
```

0 commit comments

Comments
 (0)