ani-ads-sdk 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,11 +5,37 @@ A simple guide for integrating Ani Ads into your Mini App.
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install ani-ads-sdk
8
+ npm install ani-ads-sdk @worldcoin/minikit-js
9
9
  # or
10
- pnpm add ani-ads-sdk
10
+ pnpm add ani-ads-sdk @worldcoin/minikit-js
11
11
  ```
12
12
 
13
+ **Important:** You must also install `@worldcoin/minikit-js` as a peer dependency.
14
+
15
+ ### Next.js Configuration
16
+
17
+ If you're using Next.js, you may need to configure it to handle the SDK properly. Add this to your `next.config.js` or `next.config.mjs`:
18
+
19
+ ```javascript
20
+ /** @type {import('next').NextConfig} */
21
+ const nextConfig = {
22
+ transpilePackages: ['ani-ads-sdk'],
23
+ webpack: (config, { isServer }) => {
24
+ if (!isServer) {
25
+ config.resolve.fallback = {
26
+ ...config.resolve.fallback,
27
+ fs: false,
28
+ }
29
+ }
30
+ return config
31
+ },
32
+ }
33
+
34
+ export default nextConfig
35
+ ```
36
+
37
+ Alternatively, if you're using the App Router, you can mark the component that uses AniAds as a client component with `"use client"` at the top of the file.
38
+
13
39
  ## Usage
14
40
 
15
41
  ```tsx
@@ -46,6 +72,7 @@ function MyApp() {
46
72
  ## Requirements
47
73
 
48
74
  - React 18+ or React 19+
75
+ - `@worldcoin/minikit-js` ^1.9.9 (must be installed in your project)
49
76
  - A creator wallet address and app name registered on the Ani Ads platform
50
77
 
51
78
  ## Example