|
| 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. |
0 commit comments