|
15 | 15 |
|
16 | 16 | <p align="center"><strong>All-in-one web3 SDK for Browser, Node and Mobile apps</strong></p>
|
17 | 17 |
|
18 |
| -## Features |
19 |
| - |
20 |
| -- Support for React & React-Native |
21 |
| -- First party support for [Embedded Wallets](https://portal.thirdweb.com/wallets) (social/email login) |
22 |
| -- First party support for [Account Abstraction](https://portal.thirdweb.com/wallets/sponsor-gas) |
23 |
| -- Instant connection to any chain with RPC Edge integration |
24 |
| -- Integrated IPFS upload/download |
25 |
| -- UI Components for connection, transactions, nft rendering |
26 |
| -- High level contract extensions for interacting with common standards |
| 18 | +## 📦 Packages |
| 19 | + |
| 20 | +This monorepo contains multiple packages designed to work together to provide a comprehensive web3 development experience. Each package serves a specific purpose and can be used independently or in combination with others. |
| 21 | + |
| 22 | +### Core Package |
| 23 | + |
| 24 | +#### [`thirdweb`](./packages/thirdweb/README.md) |
| 25 | +The main SDK package providing all-in-one web3 functionality for Browser, Node, and Mobile applications. |
| 26 | + |
| 27 | +```bash |
| 28 | +npm install thirdweb |
| 29 | +``` |
| 30 | + |
| 31 | +**Features:** |
| 32 | +- Type-safe contract and wallet APIs |
| 33 | +- Embedded wallets with social/email login |
| 34 | +- Account abstraction (ERC4337) support |
| 35 | +- React hooks and UI components |
27 | 36 | - Automatic ABI resolution
|
| 37 | +- IPFS upload/download |
| 38 | +- Cross-platform support (Web, React Native) |
| 39 | + |
| 40 | +### Platform Adapters |
| 41 | + |
| 42 | +#### [`@thirdweb-dev/react-native-adapter`](./packages/react-native-adapter/README.md) |
| 43 | +Required polyfills and configuration for running the thirdweb SDK in React Native applications. |
| 44 | + |
| 45 | +```bash |
| 46 | +npm install @thirdweb-dev/react-native-adapter |
| 47 | +``` |
| 48 | + |
| 49 | +**Purpose:** Provides necessary polyfills and setup instructions for React Native compatibility. |
| 50 | + |
| 51 | +#### [`@thirdweb-dev/wagmi-adapter`](./packages/wagmi-adapter/README.md) |
| 52 | +Integration layer for using thirdweb's in-app wallets with wagmi. |
| 53 | + |
| 54 | +```bash |
| 55 | +npm install @thirdweb-dev/wagmi-adapter |
| 56 | +``` |
| 57 | + |
| 58 | +**Purpose:** Enables seamless integration between thirdweb wallets and the wagmi ecosystem. |
| 59 | + |
| 60 | +### Backend Services |
| 61 | + |
| 62 | +#### [`@thirdweb-dev/engine`](./packages/engine/README.md) |
| 63 | +TypeScript SDK for Engine, thirdweb's backend onchain executor service. |
| 64 | + |
| 65 | +```bash |
| 66 | +npm install @thirdweb-dev/engine |
| 67 | +``` |
| 68 | + |
| 69 | +**Purpose:** Interact with thirdweb Engine for backend transaction execution and blockchain operations. |
| 70 | + |
| 71 | +#### [`@thirdweb-dev/vault-sdk`](./packages/vault-sdk/README.md) |
| 72 | +SDK for interacting with Vault, thirdweb's secure key management service. |
| 73 | + |
| 74 | +```bash |
| 75 | +npm install @thirdweb-dev/vault-sdk |
| 76 | +``` |
| 77 | + |
| 78 | +**Purpose:** Secure key management and wallet operations through thirdweb's Vault service. |
| 79 | + |
| 80 | +#### [`@thirdweb-dev/nebula`](./packages/nebula/README.md) |
| 81 | +TypeScript SDK for Nebula, thirdweb's AI agent service. |
| 82 | + |
| 83 | +```bash |
| 84 | +npm install @thirdweb-dev/nebula |
| 85 | +``` |
| 86 | + |
| 87 | +**Purpose:** Integrate AI-powered blockchain interactions and smart contract operations. |
| 88 | + |
| 89 | +#### [`@thirdweb-dev/insight`](./packages/insight/README.md) |
| 90 | +TypeScript SDK for Insight, thirdweb's analytics and monitoring service. |
| 91 | + |
| 92 | +```bash |
| 93 | +npm install @thirdweb-dev/insight |
| 94 | +``` |
| 95 | + |
| 96 | +**Purpose:** Analytics, monitoring, and insights for your web3 applications and smart contracts. |
| 97 | + |
| 98 | +#### [`@thirdweb-dev/api`](./packages/api/README.md) |
| 99 | +TypeScript SDK for thirdweb's general API services. |
| 100 | + |
| 101 | +```bash |
| 102 | +npm install @thirdweb-dev/api |
| 103 | +``` |
| 104 | + |
| 105 | +**Purpose:** Access thirdweb's general API endpoints for various web3 services and utilities. |
| 106 | + |
| 107 | +### Utilities |
| 108 | + |
| 109 | +#### [`@thirdweb-dev/service-utils`](./packages/service-utils/README.md) |
| 110 | +Internal utilities and shared functionality for thirdweb services. |
| 111 | + |
| 112 | +```bash |
| 113 | +npm install @thirdweb-dev/service-utils |
| 114 | +``` |
| 115 | + |
| 116 | +**Purpose:** Shared utilities, types, and helper functions used across thirdweb services. |
| 117 | + |
| 118 | +## 🚀 Quick Start |
| 119 | + |
| 120 | +### For Web Applications |
| 121 | + |
| 122 | +```bash |
| 123 | +npm install thirdweb |
| 124 | +``` |
| 125 | + |
| 126 | +```typescript |
| 127 | +import { createThirdwebClient } from "thirdweb"; |
| 128 | +import { ConnectButton } from "thirdweb/react"; |
| 129 | + |
| 130 | +const client = createThirdwebClient({ |
| 131 | + clientId: "YOUR_CLIENT_ID", |
| 132 | +}); |
| 133 | + |
| 134 | +function App() { |
| 135 | + return <ConnectButton client={client} />; |
| 136 | +} |
| 137 | +``` |
| 138 | + |
| 139 | +### For React Native Applications |
| 140 | + |
| 141 | +```bash |
| 142 | +npm install thirdweb @thirdweb-dev/react-native-adapter |
| 143 | +``` |
| 144 | + |
| 145 | +```typescript |
| 146 | +// Import at the top of your App.tsx |
| 147 | +import "@thirdweb-dev/react-native-adapter"; |
| 148 | +import { createThirdwebClient } from "thirdweb"; |
| 149 | +import { ConnectButton } from "thirdweb/react"; |
| 150 | + |
| 151 | +const client = createThirdwebClient({ |
| 152 | + clientId: "YOUR_CLIENT_ID", |
| 153 | +}); |
| 154 | + |
| 155 | +function App() { |
| 156 | + return <ConnectButton client={client} />; |
| 157 | +} |
| 158 | +``` |
| 159 | + |
| 160 | +### For Backend Applications |
| 161 | + |
| 162 | +```bash |
| 163 | +npm install thirdweb @thirdweb-dev/engine |
| 164 | +``` |
| 165 | + |
| 166 | +```typescript |
| 167 | +import { createThirdwebClient } from "thirdweb"; |
| 168 | +import { configure } from "@thirdweb-dev/engine"; |
| 169 | + |
| 170 | +// Configure Engine client |
| 171 | +configure({ |
| 172 | + secretKey: "YOUR_SECRET_KEY", |
| 173 | +}); |
| 174 | + |
| 175 | +const client = createThirdwebClient({ |
| 176 | + secretKey: "YOUR_SECRET_KEY", |
| 177 | +}); |
| 178 | +``` |
| 179 | + |
| 180 | +## 🔗 Package Dependencies |
| 181 | + |
| 182 | +```mermaid |
| 183 | +graph TD |
| 184 | + A[thirdweb] --> B[Core SDK] |
| 185 | + C[@thirdweb-dev/react-native-adapter] --> A |
| 186 | + D[@thirdweb-dev/wagmi-adapter] --> A |
| 187 | + E[@thirdweb-dev/engine] --> F[Engine API] |
| 188 | + G[@thirdweb-dev/vault-sdk] --> H[Vault Service] |
| 189 | + I[@thirdweb-dev/nebula] --> J[Nebula AI] |
| 190 | + K[@thirdweb-dev/insight] --> L[Analytics] |
| 191 | + M[@thirdweb-dev/api] --> N[thirdweb API] |
| 192 | + O[@thirdweb-dev/service-utils] --> P[Shared Utils] |
| 193 | +``` |
| 194 | + |
| 195 | +## 📚 Documentation |
| 196 | + |
| 197 | +- **Main Documentation**: [https://portal.thirdweb.com/typescript/v5](https://portal.thirdweb.com/typescript/v5) |
| 198 | +- **React Documentation**: [https://portal.thirdweb.com/typescript/v5/react](https://portal.thirdweb.com/typescript/v5/react) |
| 199 | +- **React Native Guide**: [https://portal.thirdweb.com/react-native](https://portal.thirdweb.com/react-native) |
| 200 | +- **Templates**: [https://thirdweb.com/templates](https://thirdweb.com/templates) |
| 201 | + |
| 202 | +## 🛠 Development |
| 203 | + |
| 204 | +### Prerequisites |
| 205 | + |
| 206 | +- Node.js >= 20 |
| 207 | +- pnpm >= 9 |
| 208 | + |
| 209 | +### Installation |
| 210 | + |
| 211 | +```bash |
| 212 | +pnpm install |
| 213 | +``` |
| 214 | + |
| 215 | +### Building Packages |
| 216 | + |
| 217 | +```bash |
| 218 | +# Build all packages |
| 219 | +pnpm build |
| 220 | + |
| 221 | +# Build specific package |
| 222 | +pnpm build --filter=./packages/thirdweb |
| 223 | +``` |
| 224 | + |
| 225 | +### Testing |
| 226 | + |
| 227 | +```bash |
| 228 | +# Run all tests |
| 229 | +pnpm test |
| 230 | + |
| 231 | +# Run tests for specific package |
| 232 | +pnpm test --filter=./packages/thirdweb |
| 233 | +``` |
28 | 234 |
|
29 |
| -## Library Comparison |
30 |
| - |
31 |
| -| | thirdweb | Wagmi + Viem | Ethers@6 | |
32 |
| -| ----------------------------------------- | -------- | ------------------ | -------- | |
33 |
| -| Type safe contract API | ✅ | ✅ | ✅ | |
34 |
| -| Type safe wallet API | ✅ | ✅ | ✅ | |
35 |
| -| EVM utils | ✅ | ✅ | ✅ | |
36 |
| -| RPC for any EVM | ✅ | ⚠️ public RPC only | ❌ | |
37 |
| -| Automatic ABI Resolution | ✅ | ❌ | ❌ | |
38 |
| -| IPFS Upload/Download | ✅ | ❌ | ❌ | |
39 |
| -| Embedded wallet (email/ social login) | ✅ | ⚠️ via 3rd party | ❌ | |
40 |
| -| Account abstraction (ERC4337) support | ✅ | ⚠️ via 3rd party | ❌ | |
41 |
| -| Web3 wallet connectors | ✅ | ✅ | ❌ | |
42 |
| -| Local wallet creation | ✅ | ✅ | ✅ | |
43 |
| -| Auth (SIWE) | ✅ | ✅ | ❌ | |
44 |
| -| Extensions functions for common standards | ✅ | ✅ | ❌ | |
45 |
| -| React Hooks | ✅ | ✅ | ❌ | |
46 |
| -| React UI components | ✅ | ❌ | ❌ | |
47 |
| -| React Native Hooks | ✅ | ✅ | ❌ | |
48 |
| -| React Native UI Components | ✅ | ❌ | ❌ | |
49 |
| - |
50 |
| -## Contributing |
| 235 | +## 🤝 Contributing |
51 | 236 |
|
52 | 237 | We welcome contributions from all developers regardless of experience level. If you are interested in contributing, please read our [Contributing Guide](.github/contributing.md) to learn how the repo works, how to test your changes, and how to submit a pull request.
|
53 | 238 |
|
54 | 239 | See our [open source page](https://thirdweb.com/open-source) for more information on our open-source bounties and program.
|
55 | 240 |
|
56 |
| -## Additional Resources |
| 241 | +## 📄 License |
57 | 242 |
|
58 |
| -- [Documentation](https://portal.thirdweb.com/typescript/v5) |
59 |
| -- [Templates](https://thirdweb.com/templates) |
60 |
| -- [YouTube](https://www.youtube.com/c/thirdweb) |
| 243 | +This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. |
61 | 244 |
|
62 |
| -## Support |
| 245 | +## 🆘 Support |
63 | 246 |
|
64 |
| -For help or feedback, please [visit our support site](https://thirdweb.com/support) |
| 247 | +For help or feedback, please [visit our support site](https://thirdweb.com/support) or join our [Discord community](https://discord.gg/thirdweb). |
65 | 248 |
|
66 |
| -## Security |
| 249 | +## 🔒 Security |
67 | 250 |
|
68 | 251 | If you believe you have found a security vulnerability in any of our packages, we kindly ask you not to open a public issue; and to disclose this to us by emailing `[email protected]`.
|
0 commit comments