Cannot generate tokens for authentication between extension and backend - yikes!

Topic summary

A developer is struggling with two authentication and implementation issues while building a Shopify theme extension:

Token Generation Problem:

  • Unable to generate access/session tokens for secure communication between their theme extension and backend
  • Shopify documentation indicates Admin UI block extensions are currently in developer preview
  • These extensions can only be rendered locally on development stores, not in production environments
  • Seeking alternative methods for token-based authentication that work in production

Import/Module Resolution Issue:

  • Installed @shopify/admin-ui-extensions via npm on development server
  • All import attempts fail with module resolution errors
  • Tried multiple import path variations (relative paths, node_modules references, CDN URLs)
  • Getting errors like “Relative references must start with either ‘/’, ‘./’, or ‘../’”
  • CDN references to https://cdn.shopify.com/extensions/node_modules/@shopify/admin-ui-extensions are failing

Status: The discussion remains open with no resolution. The developer needs guidance on both proper module importing and production-ready authentication approaches for Shopify extensions.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

Hi.

I am confused! I am trying to generate and use access/session tokens for authorization of communications between my theme extension and backend, but coming up short in a few ways. Pls … what am I doing wrong or ??

Problem #1.

Running on my development server, I installed via npm the @Shopify_77 /admin-ui-extensions. But when I attempt to import it into my extension js code, I keep getting failed references to the shopify CDN at https://cdn.shopify.com/extensions/node_modules/@shopify/admin-ui-extensions

I have tried all sorts of locations in the install line, none seem to work

import … from ‘@shopify/admin-ui-extensions’ => Relative references must start with either “/”, “./”, or “../”.
import {extend, TextField, Button} from ‘../../../@shopify/admin-ui-extensions’;
import {extend, TextField, Button} from ‘../../../node_modules/@shopify/admin-ui-extensions’;
import {extend, TextField, Button} from ‘/@shopify/admin-ui-extensions’
import { extend, TextField, Button } from ‘/node_modules/@shopify/admin-ui-extensions’;


Problem 2.

The documentation seems to be telling me that I cannot use this in production anyway. What should I use instead to get/use tokens?

(from https://shopify.dev/docs/api/admin-extensions#custom-protocols-extension-protocol :disappointed_face:
Admin UI block extensions are currently in developer preview. You can only render them while developing locally on a development store.

Thanks and best regards, jb