Skip to content

Error: Invalid app_name is specified #51

@BohdanchukVL

Description

@BohdanchukVL

using latest analytics npm package

"@telegram-apps/analytics": "^1.4.3"

But after deploying, analytics initialization fails with the error “Invalid app_name is specified.”

import telegramAnalytics from '@telegram-apps/analytics';

if (typeof window !== 'undefined') {
  telegramAnalytics.init({
    token: process.env.NEXT_PUBLIC_TELEGRAM_ANALYTICS_TOKEN,
    appName: process.env.NEXT_PUBLIC_TELEGRAM_ANALYTICS_IDENTIFIER,
  });
}

I’ve tried recreating the app in @DataChief_bot (both with and without the underscore) and even swapped the SDK token with the API token (which only changes the error to “Invalid token.”).
All data prints correctly in the console, so I’m sure there aren’t any extra whitespace characters or symbols. I just can’t figure out what else I can try.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions