ani-ads-sdk 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/README.md +49 -30
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,27 +1,26 @@
1
1
  # Ani Ads SDK
2
2
 
3
- SDK für Mini App Creators um Werbung in ihren Apps anzuzeigen.
3
+ React SDK for Mini App Creators to display ads in their apps.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @ani-ads/sdk
9
- # oder
10
- pnpm add @ani-ads/sdk
8
+ npm install ani-ads-sdk
9
+ # or
10
+ pnpm add ani-ads-sdk
11
11
  ```
12
12
 
13
- ## Verwendung
13
+ ## Usage
14
14
 
15
15
  ```tsx
16
- import { AniAds } from '@ani-ads/sdk'
16
+ import { AniAds } from 'ani-ads-sdk'
17
17
 
18
18
  function MyApp() {
19
19
  return (
20
20
  <AniAds
21
- creator_code="XYZ"
21
+ creator_code="YOUR_CREATOR_CODE"
22
22
  user_wallet_address="0x..."
23
- ad_format={["16:9", "9:16"]}
24
- api_url="https://your-domain.com" // Optional
23
+ api_url="https://ani-ads.vercel.app" // Optional
25
24
  onAdClick={(adId, url) => console.log('Ad clicked:', adId, url)} // Optional
26
25
  />
27
26
  )
@@ -30,32 +29,52 @@ function MyApp() {
30
29
 
31
30
  ## Props
32
31
 
33
- - `creator_code` (string, required): Eindeutiger Code für deine App
34
- - `user_wallet_address` (string, required): Wallet-Adresse des aktuellen Users
35
- - `ad_format` (string[] | string, required): Gewünschte Bildformate (z.B. `["16:9", "9:16", "1:1"]`)
36
- - `api_url` (string, optional): API URL (Standard: Production URL)
37
- - `onAdClick` (function, optional): Callback wenn Ad geklickt wird
32
+ - `creator_code` (string, required): Your unique creator code from the Ani Ads platform
33
+ - `user_wallet_address` (string, required): The wallet address of the current user viewing your app
34
+ - `api_url` (string, optional): API URL (defaults to production URL)
35
+ - `onAdClick` (function, optional): Callback function when an ad is clicked
38
36
 
39
- ## Bildformate
37
+ ## Ad Format
40
38
 
41
- - `"1:1"` oder `"11"` - Quadratisch (Square)
42
- - `"9:16"` oder `"916"` - Hochformat (Portrait)
43
- - `"16:9"` oder `"169"` - Querformat (Landscape)
39
+ All ads are displayed in a **380x90px banner format**. The SDK automatically handles image loading and display.
44
40
 
45
- ## Wie es funktioniert
41
+ ## How It Works
46
42
 
47
- Die SDK kommuniziert mit der Ani Ads API, die dann:
43
+ The SDK communicates with the Ani Ads API to:
44
+ 1. Fetch available ads for your creator code
45
+ 2. Display ads in the banner format
46
+ 3. Track clicks and process payments automatically
48
47
 
49
- 1. **Datenbank liest**: Prüft verfügbare Ads und ob User bereits geklickt hat (unique user check)
50
- 2. **Datenbank schreibt**: Speichert Clicks und Earnings
51
- 3. **Smart Contract schreibt**: Verarbeitet Zahlungen (0.005 USDC an Creator, 0.005 USDC an Platform)
48
+ **Important**: The SDK handles all backend communication automatically. You don't need to worry about:
49
+ - Unique user tracking (handled automatically)
50
+ - Payment processing (handled automatically)
51
+ - Ad rotation (handled automatically)
52
52
 
53
- **Wichtig**: Die SDK kann nicht direkt auf Datenbank oder Smart Contract zugreifen, da:
54
- - Smart Contract Write-Operationen müssen vom Contract Creator signiert werden (Private Key im Backend)
55
- - Datenbank-Zugriff läuft über die API für Sicherheit und Validierung
53
+ ## Requirements
56
54
 
57
- Bei jedem Click wird automatisch:
58
- - Geprüft ob unique user (nur einmal pro User bezahlt)
59
- - Zahlung im Smart Contract verarbeitet
60
- - Earnings in der Datenbank aktualisiert
55
+ - React 18+ or React 19+
56
+ - A creator code from the Ani Ads platform
61
57
 
58
+ ## Example
59
+
60
+ ```tsx
61
+ import React from 'react'
62
+ import { AniAds } from 'ani-ads-sdk'
63
+
64
+ function MyMiniApp() {
65
+ const userWallet = "0x1234..." // Get from your wallet connection
66
+
67
+ return (
68
+ <div>
69
+ <h1>My Mini App</h1>
70
+ <AniAds
71
+ creator_code="ABC123XY"
72
+ user_wallet_address={userWallet}
73
+ onAdClick={(adId, url) => {
74
+ console.log(`Ad ${adId} clicked, opening ${url}`)
75
+ }}
76
+ />
77
+ </div>
78
+ )
79
+ }
80
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ani-ads-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Ani Ads SDK for Mini App Creators to display ads in their apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",