Skip to content

Commit 8923d2b

Browse files
Merge pull request #195 from InsForge/claude/track-login-method
feat: track login method in telemetry
2 parents 29341aa + a62b062 commit 8923d2b

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@insforge/cli",
3-
"version": "0.1.98",
3+
"version": "0.1.99",
44
"description": "InsForge CLI - Command line tool for InsForge platform",
55
"type": "module",
66
"bin": {

src/commands/login.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export function registerLoginCommand(program: Command): void {
1717
.option('--user-api-key <key>', 'Authenticate with a uak_ user API key')
1818
.action(async (opts, cmd) => {
1919
const { json, apiUrl } = getRootOpts(cmd);
20+
// Which auth path was taken — user_api_key logins are the signal the
21+
// dashboard's connect-agent onboarding funnel is measured by.
22+
const method = opts.userApiKey ? 'user_api_key' : opts.email ? 'email' : 'oauth';
2023

2124
try {
2225
if (opts.userApiKey) {
@@ -27,12 +30,12 @@ export function registerLoginCommand(program: Command): void {
2730
await loginWithOAuth(json, apiUrl);
2831
}
2932

30-
await trackTopLevelUsage('login', true);
33+
await trackTopLevelUsage('login', true, { method });
3134
} catch (err) {
3235
if (err instanceof Error && err.message.includes('cancelled')) {
3336
process.exit(0);
3437
}
35-
await trackTopLevelUsage('login', false, {}, err);
38+
await trackTopLevelUsage('login', false, { method }, err);
3639
handleError(err, json);
3740
}
3841
});

0 commit comments

Comments
 (0)