Skip to main content

App proxy

The authenticate.public.appProxy function validates app proxy requests made by Shopify, and returns a context to enable querying Shopify APIs.

Authenticates requests coming to the app from Shopify app proxies.

Anchor to request
request
Request
required

Promise< | >
Examples

app/routes/**\/.ts

import { json } from "@remix-run/node";
import { authenticate } from "../shopify.server";

export async function action({ request }: ActionArgs) {
const { admin } = await authenticate.public.appProxy(request);

const response = await admin.graphql(
`#graphql
mutation populateProduct($input: ProductInput!) {
productCreate(input: $input) {
product {
id
}
}
}`,
{ variables: { input: { title: "Product Name" } } }
);

const productData = await response.json();
return json({ data: productData.data });
}


Was this page helpful?