native-update 1.3.6 → 1.4.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.
@@ -0,0 +1,343 @@
1
+ # Channel Management Guide
2
+
3
+ This guide explains how to use update channels (production, staging, development) to manage different environments for your app updates.
4
+
5
+ ## Overview
6
+
7
+ Native Update supports three built-in channels that allow you to:
8
+ - Test updates in development before releasing
9
+ - QA updates in staging with beta testers
10
+ - Deploy stable updates to production users
11
+
12
+ ## Channel Types
13
+
14
+ ### 1. Development Channel
15
+ **Purpose**: Local testing and rapid iteration
16
+
17
+ ```typescript
18
+ // Configure for development
19
+ await NativeUpdate.configure({
20
+ updateUrl: 'https://nativeupdate.aoneahsan.com/api/updates',
21
+ channel: 'development',
22
+ autoCheck: true,
23
+ checkInterval: 60, // Check every minute for rapid testing
24
+ });
25
+ ```
26
+
27
+ **Characteristics**:
28
+ - Fastest update delivery
29
+ - Auto-update enabled by default
30
+ - No user consent required (immediate updates)
31
+ - Ideal for internal testing
32
+
33
+ ### 2. Staging Channel
34
+ **Purpose**: QA testing and beta releases
35
+
36
+ ```typescript
37
+ // Configure for staging
38
+ await NativeUpdate.configure({
39
+ updateUrl: 'https://nativeupdate.aoneahsan.com/api/updates',
40
+ channel: 'staging',
41
+ autoCheck: true,
42
+ checkInterval: 3600, // Check every hour
43
+ });
44
+ ```
45
+
46
+ **Characteristics**:
47
+ - Beta testing environment
48
+ - User consent typically required
49
+ - Tests update flow before production
50
+ - Ideal for TestFlight/Internal Testing releases
51
+
52
+ ### 3. Production Channel
53
+ **Purpose**: Live user releases
54
+
55
+ ```typescript
56
+ // Configure for production
57
+ await NativeUpdate.configure({
58
+ updateUrl: 'https://nativeupdate.aoneahsan.com/api/updates',
59
+ channel: 'production',
60
+ autoCheck: true,
61
+ checkInterval: 86400, // Check daily
62
+ });
63
+ ```
64
+
65
+ **Characteristics**:
66
+ - Most stable updates only
67
+ - User consent required
68
+ - Gradual rollout support
69
+ - Automatic rollback on errors
70
+
71
+ ## Dashboard Channel Configuration
72
+
73
+ ### Setting Up Channels in Dashboard
74
+
75
+ 1. **Navigate to your app** in the dashboard (`/dashboard/apps`)
76
+ 2. **Click on your app** to open app details
77
+ 3. **View Channels section** - shows all three channels with their settings
78
+
79
+ ### Channel Settings
80
+
81
+ Each channel has these configurable options:
82
+
83
+ | Setting | Description | Default |
84
+ |---------|-------------|---------|
85
+ | Enabled | Whether this channel is active | true |
86
+ | Auto Update | Automatically install updates | varies |
87
+ | Update Strategy | immediate/background/manual | background |
88
+ | Require User Consent | Ask before installing | varies |
89
+ | Min Version | Minimum app version required | null |
90
+
91
+ ### Configuring Channel via Dashboard
92
+
93
+ 1. Go to **Dashboard > Apps > [Your App]**
94
+ 2. In the **Channels** section, click **Configure**
95
+ 3. Adjust settings for each channel:
96
+ - **Production**: Enable consent, use background strategy
97
+ - **Staging**: Enable auto-update, use background strategy
98
+ - **Development**: Enable auto-update, use immediate strategy
99
+
100
+ ## Uploading Builds to Channels
101
+
102
+ ### Via Dashboard Upload Page
103
+
104
+ 1. Go to **Dashboard > Upload**
105
+ 2. Select your app
106
+ 3. **Choose Channel**: Select production, staging, or development
107
+ 4. Upload your build file (zip, apk, or ipa)
108
+ 5. Fill in version details:
109
+ - Version (e.g., 1.2.3)
110
+ - Build Number
111
+ - Release Notes
112
+ - Release Type (major/minor/patch/hotfix)
113
+ 6. Click **Upload**
114
+
115
+ ### Via CLI
116
+
117
+ ```bash
118
+ # Upload to development
119
+ npx native-update bundle upload ./www --channel development --version 1.0.0
120
+
121
+ # Upload to staging
122
+ npx native-update bundle upload ./www --channel staging --version 1.0.0
123
+
124
+ # Upload to production
125
+ npx native-update bundle upload ./www --channel production --version 1.0.0
126
+ ```
127
+
128
+ ## Update Flow by Channel
129
+
130
+ ### Development Flow
131
+
132
+ ```
133
+ Developer changes code
134
+
135
+ Build locally: yarn build
136
+
137
+ Upload to development channel
138
+
139
+ App auto-downloads and applies immediately
140
+
141
+ Developer tests changes
142
+ ```
143
+
144
+ ### Staging Flow
145
+
146
+ ```
147
+ Code passes development testing
148
+
149
+ Upload to staging channel
150
+
151
+ QA team / Beta testers receive update
152
+
153
+ Users approve and install update
154
+
155
+ QA validates functionality
156
+ ```
157
+
158
+ ### Production Flow
159
+
160
+ ```
161
+ Code passes staging testing
162
+
163
+ Upload to production channel
164
+
165
+ Gradual rollout begins (10% → 50% → 100%)
166
+
167
+ Users receive update notification
168
+
169
+ Users approve and install
170
+
171
+ Monitor for errors, rollback if needed
172
+ ```
173
+
174
+ ## Environment-Based Configuration
175
+
176
+ ### React/Vite Example
177
+
178
+ ```typescript
179
+ // src/config/update-config.ts
180
+ const getUpdateConfig = () => {
181
+ const baseConfig = {
182
+ updateUrl: 'https://nativeupdate.aoneahsan.com/api/updates',
183
+ autoCheck: true,
184
+ };
185
+
186
+ if (import.meta.env.MODE === 'development') {
187
+ return {
188
+ ...baseConfig,
189
+ channel: 'development',
190
+ checkInterval: 60,
191
+ };
192
+ }
193
+
194
+ if (import.meta.env.MODE === 'staging') {
195
+ return {
196
+ ...baseConfig,
197
+ channel: 'staging',
198
+ checkInterval: 3600,
199
+ };
200
+ }
201
+
202
+ // Production
203
+ return {
204
+ ...baseConfig,
205
+ channel: 'production',
206
+ checkInterval: 86400,
207
+ };
208
+ };
209
+
210
+ export const updateConfig = getUpdateConfig();
211
+ ```
212
+
213
+ ### Capacitor Config Example
214
+
215
+ ```typescript
216
+ // capacitor.config.ts
217
+ import { CapacitorConfig } from '@capacitor/cli';
218
+
219
+ const config: CapacitorConfig = {
220
+ appId: 'com.example.myapp',
221
+ appName: 'My App',
222
+ webDir: 'dist',
223
+ plugins: {
224
+ NativeUpdate: {
225
+ updateUrl: 'https://nativeupdate.aoneahsan.com/api/updates',
226
+ channel: process.env.UPDATE_CHANNEL || 'production',
227
+ autoCheck: true,
228
+ checkInterval: 3600,
229
+ },
230
+ },
231
+ };
232
+
233
+ export default config;
234
+ ```
235
+
236
+ ## Gradual Rollouts (Production)
237
+
238
+ ### Setting Up Gradual Rollout
239
+
240
+ 1. Go to **Dashboard > Rollouts**
241
+ 2. Select your app and channel
242
+ 3. Configure rollout percentage:
243
+ - Start at 10% to catch issues early
244
+ - Increase to 50% if metrics are good
245
+ - Complete at 100% for full release
246
+
247
+ ### Rollout Best Practices
248
+
249
+ 1. **Start Small**: Begin with 5-10% of users
250
+ 2. **Monitor Errors**: Check error rates in Analytics
251
+ 3. **Watch Rollbacks**: High rollback rates indicate issues
252
+ 4. **Gradual Increase**: 10% → 25% → 50% → 100%
253
+ 5. **Pause if Needed**: Stop rollout if issues arise
254
+
255
+ ## Channel Switching at Runtime
256
+
257
+ ```typescript
258
+ // Switch channel dynamically (advanced use case)
259
+ async function switchToChannel(channel: 'production' | 'staging' | 'development') {
260
+ await NativeUpdate.configure({
261
+ channel,
262
+ });
263
+
264
+ // Force check for updates on new channel
265
+ await NativeUpdate.sync();
266
+ }
267
+ ```
268
+
269
+ ## Monitoring Channels
270
+
271
+ ### Dashboard Analytics
272
+
273
+ View per-channel metrics at **Dashboard > Analytics**:
274
+
275
+ - **Downloads**: Total downloads per channel
276
+ - **Installs**: Successful installations
277
+ - **Rollbacks**: Failed updates that rolled back
278
+ - **Errors**: Update errors
279
+
280
+ ### Per-Channel Health
281
+
282
+ | Metric | Healthy | Warning | Critical |
283
+ |--------|---------|---------|----------|
284
+ | Install Rate | >95% | 90-95% | <90% |
285
+ | Rollback Rate | <1% | 1-5% | >5% |
286
+ | Error Rate | <0.1% | 0.1-1% | >1% |
287
+
288
+ ## Best Practices
289
+
290
+ ### 1. Always Test in Development First
291
+ Never upload directly to production. Flow should be:
292
+ `Development → Staging → Production`
293
+
294
+ ### 2. Use Semantic Versioning
295
+ - **Major** (1.0.0 → 2.0.0): Breaking changes
296
+ - **Minor** (1.0.0 → 1.1.0): New features
297
+ - **Patch** (1.0.0 → 1.0.1): Bug fixes
298
+ - **Hotfix**: Emergency production fixes
299
+
300
+ ### 3. Write Clear Release Notes
301
+ Users see release notes before updating. Make them:
302
+ - Clear and concise
303
+ - Highlight important changes
304
+ - List bug fixes
305
+ - Note any required actions
306
+
307
+ ### 4. Monitor After Release
308
+ - Watch dashboard analytics for 24-48 hours
309
+ - Check error rates and rollbacks
310
+ - Be ready to pause rollout if needed
311
+
312
+ ### 5. Keep Channels in Sync
313
+ - Same code should flow through all channels
314
+ - Don't skip staging for production releases
315
+ - Document channel-specific configurations
316
+
317
+ ## Troubleshooting
318
+
319
+ ### Update Not Appearing on Device
320
+
321
+ 1. **Check channel configuration**: Ensure device is on correct channel
322
+ 2. **Verify upload**: Confirm build is uploaded to expected channel
323
+ 3. **Check version**: Device version must be compatible
324
+ 4. **Force sync**: Call `NativeUpdate.sync()` manually
325
+
326
+ ### Wrong Channel Receiving Updates
327
+
328
+ 1. **Check capacitor.config.ts**: Verify channel setting
329
+ 2. **Check environment variables**: Ensure correct env is loaded
330
+ 3. **Rebuild app**: Changes to config require rebuild
331
+
332
+ ### Rollout Stuck
333
+
334
+ 1. **Check rollout status**: View in Dashboard > Rollouts
335
+ 2. **Verify percentage**: Ensure rollout isn't paused
336
+ 3. **Check user count**: Small user bases may not hit percentage thresholds
337
+
338
+ ## Related Documentation
339
+
340
+ - [Quick Start Guide](../getting-started/quick-start.md)
341
+ - [Configuration Guide](../getting-started/configuration.md)
342
+ - [Deployment Guide](./deployment-guide.md)
343
+ - [Production Readiness](../production-readiness.md)
@@ -0,0 +1,365 @@
1
+ # Dashboard User Guide
2
+
3
+ Complete guide to using the Native Update Dashboard at [nativeupdate.aoneahsan.com](https://nativeupdate.aoneahsan.com).
4
+
5
+ ## Getting Started
6
+
7
+ ### 1. Create an Account
8
+
9
+ 1. Visit [nativeupdate.aoneahsan.com](https://nativeupdate.aoneahsan.com)
10
+ 2. Click **Get Started** or **Sign Up**
11
+ 3. Sign in with your Google account
12
+ 4. You'll be redirected to the dashboard
13
+
14
+ ### 2. Connect Google Drive
15
+
16
+ Before uploading builds, connect your Google Drive for storage:
17
+
18
+ 1. Go to **Dashboard > Google Drive**
19
+ 2. Click **Connect Google Drive**
20
+ 3. Authorize the application
21
+ 4. Your builds will be stored in a dedicated folder
22
+
23
+ ## Dashboard Overview
24
+
25
+ ### Navigation
26
+
27
+ The dashboard sidebar contains:
28
+
29
+ | Section | Description |
30
+ |---------|-------------|
31
+ | **Overview** | Dashboard home with stats |
32
+ | **Apps** | Manage your applications |
33
+ | **Builds** | View and manage all builds |
34
+ | **Upload** | Upload new builds |
35
+ | **Rollouts** | Manage gradual rollouts |
36
+ | **Analytics** | View update metrics |
37
+ | **Google Drive** | Manage storage connection |
38
+ | **Configuration** | Get integration code snippets |
39
+ | **Settings** | Account settings |
40
+
41
+ ## Managing Apps
42
+
43
+ ### Creating an App
44
+
45
+ 1. Go to **Dashboard > Apps**
46
+ 2. Click **Create App**
47
+ 3. Fill in the details:
48
+ - **App Name**: Display name (e.g., "My Awesome App")
49
+ - **Package ID**: Unique identifier (e.g., `com.example.myapp`)
50
+ - **Description**: Brief description
51
+ - **Platforms**: Select iOS, Android, and/or Web
52
+ 4. Click **Create App**
53
+
54
+ ### App Details Page
55
+
56
+ Click on any app to view:
57
+
58
+ - **Overview Cards**: Total builds, active users, platforms, last build date
59
+ - **Channels**: Production, staging, development settings
60
+ - **Active Rollouts**: Current rollout status
61
+ - **Recent Builds**: Latest builds for this app
62
+
63
+ ### Configuring Channels
64
+
65
+ Each app has three channels with configurable settings:
66
+
67
+ 1. In the app details page, find the **Channels** section
68
+ 2. Click **Configure** on any channel
69
+ 3. Adjust settings:
70
+ - **Enabled**: Turn channel on/off
71
+ - **Auto Update**: Automatically install updates
72
+ - **Update Strategy**: immediate/background/manual
73
+ - **Require User Consent**: Ask before installing
74
+ - **Min Version**: Minimum required app version
75
+
76
+ ## Uploading Builds
77
+
78
+ ### Upload Process
79
+
80
+ 1. Go to **Dashboard > Upload**
81
+ 2. **Select App**: Choose from your registered apps
82
+ 3. **Select Channel**: production, staging, or development
83
+ 4. **Select Platform**: iOS, Android, or Web
84
+ 5. **Upload File**: Drag and drop or click to select
85
+ - Supported formats: `.zip`, `.apk`, `.ipa`
86
+ 6. **Enter Version Info**:
87
+ - **Version**: Semantic version (e.g., 1.2.3)
88
+ - **Build Number**: Incremental build number
89
+ - **Release Notes**: What's new in this version
90
+ - **Release Type**: major/minor/patch/hotfix
91
+ - **Pre-release**: Check if this is a beta/alpha
92
+
93
+ 7. Click **Upload Build**
94
+
95
+ ### Build Requirements
96
+
97
+ | Platform | File Type | Contents |
98
+ |----------|-----------|----------|
99
+ | Web | `.zip` | Built web assets (dist/www folder) |
100
+ | Android | `.apk` or `.zip` | APK or web assets |
101
+ | iOS | `.ipa` or `.zip` | IPA or web assets |
102
+
103
+ ### Upload Progress
104
+
105
+ The upload page shows:
106
+ - Upload progress percentage
107
+ - File validation status
108
+ - Checksum generation
109
+ - Google Drive upload status
110
+
111
+ ## Managing Builds
112
+
113
+ ### Builds List
114
+
115
+ Go to **Dashboard > Builds** to see all builds:
116
+
117
+ - **Version**: Build version (clickable for details)
118
+ - **App**: Associated application
119
+ - **Channel**: Deployment channel
120
+ - **Platform**: Target platform
121
+ - **Status**: active/processing/failed/archived
122
+ - **Size**: File size
123
+ - **Uploaded**: Upload date/time
124
+
125
+ ### Build Detail Page
126
+
127
+ Click on a version to view complete build information:
128
+
129
+ **Stats Cards**:
130
+ - Downloads: Total download count
131
+ - Installs: Successful installations
132
+ - Rollbacks: Reverted updates
133
+ - Errors: Failed installations
134
+
135
+ **Build Information**:
136
+ - Version, build number, version code
137
+ - Channel, platform, release type
138
+ - Pre-release status
139
+
140
+ **File Details**:
141
+ - File name, size, type, MIME type
142
+ - Checksum (SHA-256)
143
+ - Signature (if signed)
144
+
145
+ **Release Notes**:
146
+ - Full release notes text
147
+
148
+ **Upload Information**:
149
+ - Upload timestamp
150
+ - Uploader email
151
+ - Upload duration
152
+
153
+ ### Build Actions
154
+
155
+ - **Download**: Download the build file from Google Drive
156
+ - **Delete**: Remove the build (with confirmation)
157
+
158
+ ## Rollouts
159
+
160
+ ### Creating a Rollout
161
+
162
+ 1. Go to **Dashboard > Rollouts**
163
+ 2. Click **Create Rollout**
164
+ 3. Select app and channel
165
+ 4. Set initial percentage (e.g., 10%)
166
+ 5. Click **Start Rollout**
167
+
168
+ ### Managing Rollouts
169
+
170
+ For active rollouts, you can:
171
+
172
+ - **Increase Percentage**: Gradually roll out to more users
173
+ - **Pause**: Stop the rollout temporarily
174
+ - **Resume**: Continue a paused rollout
175
+ - **Complete**: Set to 100% to finish rollout
176
+
177
+ ### Rollout Status
178
+
179
+ | Status | Description |
180
+ |--------|-------------|
181
+ | Active | Rollout is in progress |
182
+ | Paused | Rollout is temporarily stopped |
183
+ | Completed | Rollout reached 100% |
184
+
185
+ ## Analytics
186
+
187
+ ### Overview Metrics
188
+
189
+ The Analytics page shows:
190
+
191
+ - **Total Downloads**: All-time download count
192
+ - **Total Installs**: Successful installations
193
+ - **Success Rate**: Install/download ratio
194
+ - **Active Users**: Currently active users
195
+
196
+ ### Per-App Analytics
197
+
198
+ Select an app to view:
199
+
200
+ - Download trends over time
201
+ - Install success rates
202
+ - Error rates
203
+ - Rollback statistics
204
+ - Channel-specific metrics
205
+
206
+ ## Configuration
207
+
208
+ ### Getting Integration Code
209
+
210
+ 1. Go to **Dashboard > Configuration**
211
+ 2. Select your app from the dropdown
212
+ 3. Copy the configuration for your platform:
213
+
214
+ **iOS (Info.plist)**:
215
+ ```xml
216
+ <key>NativeUpdateConfig</key>
217
+ <dict>
218
+ <key>appId</key>
219
+ <string>com.example.myapp</string>
220
+ <key>updateUrl</key>
221
+ <string>https://nativeupdate.aoneahsan.com/api/updates</string>
222
+ <key>channel</key>
223
+ <string>production</string>
224
+ </dict>
225
+ ```
226
+
227
+ **Android (AndroidManifest.xml)**:
228
+ ```xml
229
+ <meta-data
230
+ android:name="com.aoneahsan.nativeupdate.appId"
231
+ android:value="com.example.myapp" />
232
+ <meta-data
233
+ android:name="com.aoneahsan.nativeupdate.updateUrl"
234
+ android:value="https://nativeupdate.aoneahsan.com/api/updates" />
235
+ ```
236
+
237
+ **Capacitor (capacitor.config.ts)**:
238
+ ```typescript
239
+ plugins: {
240
+ NativeUpdate: {
241
+ appId: 'com.example.myapp',
242
+ updateUrl: 'https://nativeupdate.aoneahsan.com/api/updates',
243
+ channel: 'production',
244
+ }
245
+ }
246
+ ```
247
+
248
+ **JavaScript/TypeScript**:
249
+ ```typescript
250
+ import { NativeUpdate } from 'native-update';
251
+
252
+ await NativeUpdate.configure({
253
+ updateUrl: 'https://nativeupdate.aoneahsan.com/api/updates',
254
+ });
255
+ ```
256
+
257
+ ## Settings
258
+
259
+ ### Account Settings
260
+
261
+ Go to **Dashboard > Settings** to manage:
262
+
263
+ - **Profile**: Display name, email, photo
264
+ - **Preferences**:
265
+ - Email notifications
266
+ - Update notifications
267
+ - Theme (light/dark/auto)
268
+ - Language
269
+
270
+ ### Plan Information
271
+
272
+ View your current plan:
273
+
274
+ - **Beta**: Free tier with full features
275
+ - **Pro**: Enhanced limits and support
276
+ - **Enterprise**: Custom solutions
277
+
278
+ ## Common Workflows
279
+
280
+ ### First-Time Setup
281
+
282
+ 1. Sign up and connect Google Drive
283
+ 2. Create your first app
284
+ 3. Configure channel settings
285
+ 4. Copy integration code to your app
286
+ 5. Build and upload your first version
287
+ 6. Test on development channel
288
+ 7. Promote to staging, then production
289
+
290
+ ### Deploying an Update
291
+
292
+ 1. Make changes to your app code
293
+ 2. Build: `yarn build` or `npm run build`
294
+ 3. Go to Dashboard > Upload
295
+ 4. Select app, channel, and platform
296
+ 5. Upload the build file
297
+ 6. Add version and release notes
298
+ 7. Monitor in Analytics
299
+
300
+ ### Emergency Hotfix
301
+
302
+ 1. Fix the critical issue in code
303
+ 2. Build immediately
304
+ 3. Upload to production channel
305
+ 4. Set release type to "hotfix"
306
+ 5. Create immediate rollout (100%)
307
+ 6. Monitor for issues
308
+
309
+ ### Rolling Back
310
+
311
+ 1. Go to Dashboard > Builds
312
+ 2. Find the previous stable version
313
+ 3. Create a new rollout for that version
314
+ 4. Or: The plugin automatically rolls back on crash
315
+
316
+ ## Troubleshooting
317
+
318
+ ### Upload Failed
319
+
320
+ - **Check file size**: Max 500MB per upload
321
+ - **Check file format**: Must be .zip, .apk, or .ipa
322
+ - **Check Google Drive**: Ensure connected and has space
323
+ - **Check network**: Stable connection required
324
+
325
+ ### Build Not Appearing on Device
326
+
327
+ 1. Verify build is uploaded to correct channel
328
+ 2. Check device is configured for same channel
329
+ 3. Force sync: Call `NativeUpdate.sync()`
330
+ 4. Check app version compatibility
331
+
332
+ ### Google Drive Disconnected
333
+
334
+ 1. Go to Dashboard > Google Drive
335
+ 2. Click **Reconnect**
336
+ 3. Re-authorize the application
337
+
338
+ ### Analytics Not Updating
339
+
340
+ - Allow 15-30 minutes for data processing
341
+ - Ensure devices have network connectivity
342
+ - Check that events are being sent from app
343
+
344
+ ## API Endpoint
345
+
346
+ The dashboard uses this API endpoint for updates:
347
+
348
+ ```
349
+ https://nativeupdate.aoneahsan.com/api/updates
350
+ ```
351
+
352
+ Use this URL in your app configuration.
353
+
354
+ ## Support
355
+
356
+ - **Email**: aoneahsan@gmail.com
357
+ - **Documentation**: [docs folder](../README.md)
358
+ - **Website**: [nativeupdate.aoneahsan.com](https://nativeupdate.aoneahsan.com)
359
+
360
+ ## Related Documentation
361
+
362
+ - [Channel Management](./channel-management.md)
363
+ - [Quick Start Guide](../getting-started/quick-start.md)
364
+ - [Configuration Guide](../getting-started/configuration.md)
365
+ - [End-to-End Workflow](./end-to-end-workflow.md)