@kasabeh/a3d-sdk 0.1.0

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/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@kasabeh/a3d-sdk",
3
+ "version": "0.1.0",
4
+ "description": "Native 3D advertising SDK for Three.js / React Three Fiber. OpenRTB 2.6 auction, GLB creative rendering, and IIG-aligned viewability.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Kasabeh",
8
+ "homepage": "https://a3d.io",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/kasabeh/a3d.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/kasabeh/a3d/issues"
15
+ },
16
+ "keywords": [
17
+ "3d",
18
+ "advertising",
19
+ "ads",
20
+ "three.js",
21
+ "react-three-fiber",
22
+ "webgl",
23
+ "openrtb",
24
+ "monetization",
25
+ "ad-tech",
26
+ "glb"
27
+ ],
28
+ "sideEffects": false,
29
+ "exports": {
30
+ ".": {
31
+ "types": "./a3d/index.d.ts",
32
+ "import": "./index.mjs",
33
+ "require": "./index.cjs"
34
+ }
35
+ },
36
+ "main": "./index.cjs",
37
+ "module": "./index.mjs",
38
+ "types": "./a3d/index.d.ts",
39
+ "files": [
40
+ "index.mjs",
41
+ "index.cjs",
42
+ "index.mjs.map",
43
+ "index.cjs.map",
44
+ "a3d/",
45
+ "hooks/",
46
+ "lib/",
47
+ "types/"
48
+ ],
49
+ "peerDependencies": {
50
+ "react": ">=18",
51
+ "react-dom": ">=18",
52
+ "three": ">=0.160",
53
+ "@react-three/fiber": ">=8",
54
+ "@react-three/drei": ">=9"
55
+ },
56
+ "peerDependenciesMeta": {
57
+ "@react-three/drei": {
58
+ "optional": false
59
+ },
60
+ "@react-three/fiber": {
61
+ "optional": false
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,156 @@
1
+ export interface BidRequest {
2
+ id: string;
3
+ imp: Imp[];
4
+ site: SiteInfo;
5
+ device: Device;
6
+ /** Auction type: 1 = first price (we always declare 1). */
7
+ at: number;
8
+ /** Allowed currencies for bids. */
9
+ cur: string[];
10
+ /** Max milliseconds for bids to arrive, including network latency. */
11
+ tmax: number;
12
+ source?: Source;
13
+ regs?: Regs;
14
+ /** 1 = test mode, bids are not billable. */
15
+ test?: 0 | 1;
16
+ }
17
+ export interface Imp {
18
+ id: string;
19
+ bidfloor: number;
20
+ bidfloorcur: string;
21
+ /** 1 = creative assets must be served over HTTPS. */
22
+ secure?: 0 | 1;
23
+ ext: {
24
+ threeds: ImpThreeDS;
25
+ };
26
+ }
27
+ export interface ImpThreeDS {
28
+ max_width: number;
29
+ max_height: number;
30
+ max_depth: number;
31
+ scene_type: string;
32
+ surface_type: string;
33
+ tags: string[];
34
+ placement_type: 'static' | 'floating' | 'interactive';
35
+ interaction: string[];
36
+ anchor: [number, number, number];
37
+ }
38
+ export interface SiteInfo {
39
+ id?: string;
40
+ name: string;
41
+ domain: string;
42
+ page: string;
43
+ cat?: string[];
44
+ publisher?: {
45
+ id: string;
46
+ };
47
+ }
48
+ export interface Device {
49
+ ua: string;
50
+ w: number;
51
+ h: number;
52
+ language: string;
53
+ /** OpenRTB device type: 1 = mobile/tablet, 2 = personal computer. */
54
+ devicetype?: number;
55
+ }
56
+ /** Supply-chain transparency (source.schain) — one node: us, complete. */
57
+ export interface Source {
58
+ /** Transaction ID common to all participants in this bid request. */
59
+ tid: string;
60
+ schain?: {
61
+ complete: 0 | 1;
62
+ ver: string;
63
+ nodes: Array<{
64
+ asi: string;
65
+ sid: string;
66
+ hp: 0 | 1;
67
+ }>;
68
+ };
69
+ }
70
+ /** Regulatory signals; GPP is the current umbrella consent string. */
71
+ export interface Regs {
72
+ coppa?: 0 | 1;
73
+ gdpr?: 0 | 1;
74
+ gpp?: string;
75
+ gpp_sid?: number[];
76
+ }
77
+ export interface BidResponse {
78
+ id: string;
79
+ /** Absent (with nbr set) when there is no fill. */
80
+ seatbid?: SeatBid[];
81
+ bidid?: string;
82
+ cur?: string;
83
+ /** No-bid reason code when seatbid is absent. */
84
+ nbr?: number;
85
+ }
86
+ export interface SeatBid {
87
+ bid: Bid[];
88
+ seat: string;
89
+ }
90
+ export interface Bid {
91
+ id: string;
92
+ impid: string;
93
+ price: number;
94
+ adid: string;
95
+ /** Campaign ID (mirrors adid in our stack). */
96
+ cid?: string;
97
+ crid: string;
98
+ /** Advertiser domains for brand-safety/blocklist checks. */
99
+ adomain?: string[];
100
+ /** Win notice URL (win signal only — never billed). */
101
+ nurl?: string;
102
+ /**
103
+ * Billing notice URL — fired when the creative renders; supports the
104
+ * ${AUCTION_PRICE}/${AUCTION_ID}/${AUCTION_IMP_ID}/${AUCTION_CURRENCY} macros.
105
+ */
106
+ burl?: string;
107
+ /** Seconds the win may wait for render before the billing token lapses. */
108
+ exp?: number;
109
+ adm: string;
110
+ ext: {
111
+ threeds: BidThreeDS;
112
+ };
113
+ }
114
+ export interface BidThreeDS {
115
+ model_url: string;
116
+ file_type: 'glb' | 'gltf' | 'spline_url';
117
+ model_dimensions: {
118
+ width: number;
119
+ height: number;
120
+ depth: number;
121
+ };
122
+ click_url: string | null;
123
+ /** Tokenized server-side click tracker: records the click, then 302s to click_url. */
124
+ click_through_url: string | null;
125
+ campaign_name: string;
126
+ thumbnail_url: string | null;
127
+ compatible_scenes: string[];
128
+ tags: string[];
129
+ }
130
+ export interface AdEventPayload {
131
+ event_type: 'impression' | 'viewable' | 'click' | 'rotate' | 'zoom' | 'hover' | 'engagement';
132
+ campaign_id: string;
133
+ placement_id: string;
134
+ bid_price: number;
135
+ engagement_time_ms?: number;
136
+ }
137
+ export interface ResolvedAd {
138
+ placementId: string;
139
+ modelUrl: string;
140
+ fileType: 'glb' | 'gltf' | 'spline_url';
141
+ clickUrl: string | null;
142
+ /** Tracked redirect through the ad server (preferred over clickUrl). */
143
+ clickThroughUrl: string | null;
144
+ /** Billing notice (bid.burl, macros substituted) — fired once on render. */
145
+ billingUrl: string | null;
146
+ campaignId: string;
147
+ creativeId: string;
148
+ bidPrice: number;
149
+ campaignName: string;
150
+ thumbnailUrl: string | null;
151
+ modelDimensions: {
152
+ width: number;
153
+ height: number;
154
+ depth: number;
155
+ };
156
+ }