
Security News
Socket Security Analysis Is Now One Click Away on npm
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.
@shipengine/alchemy
Advanced tools
`shipengine/alchemy` is a toolkit for building re-usable, fully-featured, data-connected and cross-compatible React components (“Elements”)[^1] for use in applications that utilize the [ShipEngine API](https://shipengine.github.io/shipengine-openapi/).
shipengine/alchemy is a toolkit for building re-usable, fully-featured, data-connected and cross-compatible React components (“Elements”)[^1] for use in applications that utilize the ShipEngine API.
The library makes opinionated choices about API access, state management, language translations[^2] and UI foundations.
Available to all descendants of the AlchemyProvider:
themeConfig prop and accessible on the Emotion css callback prop, and icons via Giger's Icon component.Available to components created via the alchemy.createElement factory:
i18next is provided for each Element. Individual translations can be overriden at the Element's point-of-use via the optional resources prop.ErrorBoundary.[!IMPORTANT]
In addition to @shipengine/alchemy, you must also add @shipengine/react-api and @shipengine/js-api to your project's dependencies.
AlchemyProvider should be rendered near the top of the application's component hiearchycreateElement factory is used to create stylistically isolated components that will utilize the AlchemyProvider's API client and theme.import alchemy, { AlchemyProvider, useListShipments } from "@shipengine/alchemy";
import { themeConfig } from "../themeConfig";
type MyComponentProps = {
myProp: string;
};
const MyComponent = ({ myProp }: MyComponentProps) => {
const { data, isLoading, error } = useListShipments();
if (isLoading) return <div>Loading...</div>;
if (error) return <div>{error.message}</div>;
console.log(data);
// > an object matching the response schema of https://shipengine.github.io/shipengine-openapi/#operation/list_shipments
return (
<div
css={(theme) => ({
/* ... */
})}
>
Retrieved {data.shipments.length} shipments
</div>
);
};
// Your own component that the ErrorBoundary will display when an error occurs
const MyErrorFallback = ({ error }) => <div>Whoops...</div>;
const MyElement = alchemy.createElement(
MyComponent,
MyErrorFallback,
// optional configuration object
{
// applied to the container
css: (theme) => ({
// ...
}),
// i18next translations
resources: {
// ...
},
}
);
const MyApp = () => {
return (
<AlchemyProvider getToken={() => "your-platform-token"} themeConfig={themeConfig}>
<section>
Your pre-existing application
<div>
Locate the Element wherever you like
<MyElement
myProp="just a regular prop"
// optional translations override prop added by the factory
resources={{}}
/>
</div>
</section>
</AlchemyProvider>
);
};
FAQs
`shipengine/alchemy` is a toolkit for building re-usable, fully-featured, data-connected and cross-compatible React components (“Elements”)[^1] for use in applications that utilize the [ShipEngine API](https://shipengine.github.io/shipengine-openapi/).
The npm package @shipengine/alchemy receives a total of 925 weekly downloads. As such, @shipengine/alchemy popularity was classified as not popular.
We found that @shipengine/alchemy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 43 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.