insert-affiliate-js-sdk 1.0.2 → 1.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/.claude/settings.local.json +10 -0
- package/CHANGELOG.md +60 -0
- package/README.md +600 -30
- package/dist/index.d.ts +35 -4
- package/dist/index.js +347 -37
- package/package.json +1 -1
- package/src/sdk/InsertAffiliate.ts +459 -37
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Insert Affiliate JavaScript SDK will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.1.0] - 2025-11-23
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **New `getAffiliateDetails()` method** - Retrieve affiliate information without setting the identifier
|
|
12
|
+
- Returns `Promise<AffiliateDetails | null>` with affiliateName, affiliateShortCode, and deeplinkUrl
|
|
13
|
+
- Useful for displaying affiliate info or showing personalized content based on referrer
|
|
14
|
+
- Automatically strips UUIDs from codes
|
|
15
|
+
- Works with both short codes and deep link URLs
|
|
16
|
+
|
|
17
|
+
- **New `AffiliateDetails` interface** - Exported interface for affiliate information
|
|
18
|
+
- Contains affiliateName, affiliateShortCode, and deeplinkUrl properties
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- **BREAKING: `setShortCode()` now returns validation result** - Method signature changed from `Promise<void>` to `Promise<boolean>`
|
|
22
|
+
- Validates short codes against the Insert Affiliate API before storing
|
|
23
|
+
- Returns `true` if code is valid and stored, `false` otherwise
|
|
24
|
+
- Provides immediate feedback for user-facing validation
|
|
25
|
+
- Console logs success message with affiliate name when validation succeeds
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- **Offer Code API** - Fixed `fetchAndConditionallyOpenUrl()` to properly include company code in API requests
|
|
29
|
+
- URL now correctly formatted as: `/v1/affiliateReturnOfferCode/{companyCode}/{affiliateLink}`
|
|
30
|
+
- Ensures offer codes are properly retrieved from the API
|
|
31
|
+
|
|
32
|
+
### Documentation
|
|
33
|
+
- Added comprehensive README documentation for `getAffiliateDetails()`
|
|
34
|
+
- Updated `setShortCode()` documentation with validation examples
|
|
35
|
+
- Added JavaScript/TypeScript code examples showing async/await patterns with alerts
|
|
36
|
+
- Updated API reference section with new method signatures
|
|
37
|
+
|
|
38
|
+
## [1.0.2] - 2024-11-22
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
- Various bug fixes and improvements
|
|
42
|
+
|
|
43
|
+
## [1.0.1] - 2024-11-02
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
- Initial release fixes
|
|
47
|
+
|
|
48
|
+
## [1.0.0] - 2024-03-25
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
- Initial release of Insert Affiliate JavaScript SDK
|
|
52
|
+
- Affiliate tracking and attribution
|
|
53
|
+
- Short code support
|
|
54
|
+
- Deep linking integration
|
|
55
|
+
- Event tracking
|
|
56
|
+
- Offer codes support
|
|
57
|
+
- Attribution timeout functionality
|
|
58
|
+
- URL parameter detection (`insertAffiliate`)
|
|
59
|
+
- Stripe integration support
|
|
60
|
+
- Iaptic purchase validation
|