Skip to content

Commit 484a4ce

Browse files
committed
docs: add AI-friendly documentation for LLM assistants
- Add llms.txt and llms-full.txt for AI assistants (Cursor, Copilot, Claude, ChatGPT) - Add AI Assistants guide page with setup instructions - Update README with AI assistants section and quick links - Update sidebar to include AI Assistants page
1 parent 4253bec commit 484a4ce

File tree

5 files changed

+1459
-0
lines changed

5 files changed

+1459
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ If you're shipping an app with expo-iap, we’d love to hear about it—please s
3232

3333
**[📖 Visit our comprehensive documentation site →](https://hyochan.github.io/expo-iap)**
3434

35+
## Using with AI Assistants
36+
37+
expo-iap provides AI-friendly documentation for Cursor, GitHub Copilot, Claude, and ChatGPT.
38+
39+
**[📖 AI Assistants Guide →](https://hyochan.github.io/expo-iap/guides/ai-assistants)**
40+
41+
Quick links:
42+
- [llms.txt](https://hyochan.github.io/expo-iap/llms.txt) - Quick reference
43+
- [llms-full.txt](https://hyochan.github.io/expo-iap/llms-full.txt) - Full API reference
44+
3545
## Notice
3646

3747
The `expo-iap` module has been migrated from [react-native-iap](https://github.com/hyochan/react-native-iap). While we initially considered fully merging everything into `react-native-iap`, we ultimately decided to maintain the two libraries in parallel, each tailored to its own ecosystem.

docs/docs/guides/ai-assistants.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
sidebar_position: 10
3+
title: Using with AI Assistants
4+
---
5+
6+
import IapKitBanner from "@site/src/uis/IapKitBanner";
7+
8+
# Using with AI Assistants
9+
10+
<IapKitBanner />
11+
12+
expo-iap provides AI-friendly documentation for use with AI coding assistants like Cursor, GitHub Copilot, Claude, and ChatGPT.
13+
14+
## AI-Optimized Documentation
15+
16+
We provide two documentation formats optimized for AI assistants:
17+
18+
| Format | Description | URL |
19+
|--------|-------------|-----|
20+
| Quick Reference | Concise API overview (~300 lines) | [llms.txt](/llms.txt) |
21+
| Full Reference | Complete API documentation (~1000 lines) | [llms-full.txt](/llms-full.txt) |
22+
23+
## Add to Cursor
24+
25+
[Cursor](https://cursor.sh/) allows you to add custom documentation sources:
26+
27+
1. Open Cursor Settings (`Cmd+,` on Mac or `Ctrl+,` on Windows/Linux)
28+
2. Go to **Features** > **Docs**
29+
3. Click **Add new doc**
30+
4. Enter the URL: `https://hyochan.github.io/expo-iap/llms.txt`
31+
5. Give it a name like "expo-iap"
32+
33+
Now when you ask Cursor about expo-iap, it will reference the official documentation.
34+
35+
## Add to GitHub Copilot
36+
37+
For GitHub Copilot Chat in VS Code:
38+
39+
1. Open a new chat (`Ctrl+Shift+I` or `Cmd+Shift+I`)
40+
2. Reference the documentation URL in your prompt:
41+
42+
```
43+
@workspace Using https://hyochan.github.io/expo-iap/llms-full.txt as reference,
44+
help me implement in-app purchases with expo-iap
45+
```
46+
47+
## Add to Claude or ChatGPT
48+
49+
When using Claude or ChatGPT, you can provide the documentation URL directly in your prompt:
50+
51+
```
52+
Please refer to https://hyochan.github.io/expo-iap/llms-full.txt for the expo-iap API documentation.
53+
54+
Help me implement a subscription purchase flow with expo-iap.
55+
```
56+
57+
Or paste the content of `llms.txt` or `llms-full.txt` directly into your conversation for better context.
58+
59+
## Direct URL Access
60+
61+
You can access the AI documentation directly:
62+
63+
- **Quick Reference**: [https://hyochan.github.io/expo-iap/llms.txt](https://hyochan.github.io/expo-iap/llms.txt)
64+
- **Full Reference**: [https://hyochan.github.io/expo-iap/llms-full.txt](https://hyochan.github.io/expo-iap/llms-full.txt)
65+
66+
## What's Included
67+
68+
### Quick Reference (`llms.txt`)
69+
70+
- Installation instructions
71+
- `useIAP` hook basic usage
72+
- Core API signatures
73+
- Key type definitions
74+
- Common patterns
75+
- Error handling basics
76+
77+
### Full Reference (`llms-full.txt`)
78+
79+
- Complete installation and configuration guide
80+
- Full `useIAP` hook API with all options
81+
- All direct API functions with examples
82+
- Complete type definitions
83+
- Full error code reference
84+
- iOS and Android platform-specific APIs
85+
- Common implementation patterns
86+
- Troubleshooting guide
87+
88+
## Example Prompts
89+
90+
Here are some example prompts that work well with the AI documentation:
91+
92+
### Basic Setup
93+
94+
```
95+
Using expo-iap documentation, show me how to set up a basic store
96+
with product fetching and purchase handling.
97+
```
98+
99+
### Subscription Implementation
100+
101+
```
102+
How do I implement subscription purchases with expo-iap?
103+
Include Android offer tokens handling.
104+
```
105+
106+
### Error Handling
107+
108+
```
109+
What are all the error codes in expo-iap and how should I handle them?
110+
```
111+
112+
### Platform-Specific Features
113+
114+
```
115+
Show me how to use iOS-specific features like refund requests
116+
and subscription status checking in expo-iap.
117+
```
118+
119+
### Restore Purchases
120+
121+
```
122+
How do I implement a "Restore Purchases" button with expo-iap?
123+
```
124+
125+
## Tips for Better Results
126+
127+
1. **Be specific**: Mention expo-iap explicitly in your prompts
128+
2. **Reference the docs**: Include the documentation URL for more accurate answers
129+
3. **Provide context**: Mention your platform (iOS/Android) if relevant
130+
4. **Ask for examples**: Request code examples for practical implementation
131+
132+
## Feedback
133+
134+
If you find issues with the AI documentation or have suggestions for improvement, please [open an issue](https://github.com/hyochan/expo-iap/issues) on GitHub.

docs/sidebars.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ const sidebars: SidebarsConfig = {
9696
'examples/alternative-billing',
9797
],
9898
},
99+
{
100+
type: 'doc',
101+
id: 'guides/ai-assistants',
102+
label: 'AI Assistants',
103+
},
99104
{
100105
type: 'doc',
101106
id: 'sponsors',

0 commit comments

Comments
 (0)