
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@nestjs-shopify/fastify
Advanced tools
A wrapper for [@shopify/shopify-node-api](https://github.com/Shopify/shopify-node-api) to setup your Shopify context in a Fastify NestJS application.
A wrapper for @shopify/shopify-node-api to setup your Shopify context in a Fastify NestJS application.
Install package using NPM:
npm i @shopify/shopify-api @nestjs-shopify/core @nestjs-shopify/fastify
or using Yarn:
yarn add @shopify/shopify-api @nestjs-shopify/core @nestjs-shopify/fastify
From your application root module, import the ShopifyFastifyModule
using forRoot
, or if you have dynamic config using forRootAsync
:
// app.module.ts
@Module({
imports: [
ShopifyFastifyModule.forRoot({
apiKey: 'foo',
apiSecretKey: 'bar',
apiVersion: ApiVersion.Unstable,
hostName: 'localhost:8081',
isEmbeddedApp: true,
scopes: ['test_scope'],
}),
],
})
export class AppModule {}
or if you want to inject your configuration dynamically (maybe using @nestjs/config
), use forRootAsync
:
// app.module.ts
import { ConfigService } from '@nestjs/config';
@Module({
imports: [
ShopifyFastifyModule.forRootAsync({
useFactory: async (configService: ConfigService) => {
return {
apiKey: configService.get('SHOPIFY_API_KEY'),
apiSecretKey: configService.get('SHOPIFY_API_SECRET'),
apiVersion: ApiVersion.Unstable,
hostName: configService.get('HOST').replace(/https:\/\//, ''),
isEmbeddedApp: true,
scopes: ['test_scope'],
};
},
inject: [ConfigService],
}),
],
})
export class AppModule {}
The library allows your to inject your own session storage. For instance, if you use Redis based session storage. You could create an @Injectable()
class that implements the SessionStorage
interface. And use this injected class in your config:
// app.module.ts
import { ConfigService } from '@nestjs/config';
import { MyRedisSessionStorage } from './my-redis-session-storage';
@Module({
imports: [
ShopifyFastifyModule.forRootAsync({
useFactory: async (configService: ConfigService, sessionStorage: MyRedisSessionStorage) => {
return {
apiKey: configService.get('SHOPIFY_API_KEY'),
apiSecret: configService.get('SHOPIFY_API_SECRET'),
apiVersion: ApiVersion.Unstable,
hostName: configService.get('HOST').replace(/https:\/\//, ''),
isEmbeddedApp: true,
scopes: ['test_scope'],
sessionStorage,
};
},
provide: [MyRedisSessionStorage],
inject: [ConfigService, MyRedisSessionStorage],
}),
],
})
export class AppModule {}
// my-redis-session-storage.ts
import { Injectable } from '@nestjs/common';
import { SessionStorage } from '@nestjs-shopify/core';
import { Session } from '@shopify/shopify-api';
@Injectable()
export class MyRedisSessionStorage implements SessionStorage {
async storeSession(session: Session): Promise<boolean> {
// ... implement your redis store logic
}
async loadSession(id: string): Promise<Session | undefined> {
// ... implement your redis load logic
}
async deleteSession(id: string): Promise<boolean> {
// ... implement your redis delete logic
}
async deleteSessions(ids: string[]): Promise<boolean> {
// ... implement your redis multi-delete logic
}
async findSessionsByShop(shop: string): Promise<Session[]> {
// ... implement your redis multi-find logic
}
}
FAQs
A wrapper for [@shopify/shopify-node-api](https://github.com/Shopify/shopify-node-api) to setup your Shopify context in a Fastify NestJS application.
The npm package @nestjs-shopify/fastify receives a total of 229 weekly downloads. As such, @nestjs-shopify/fastify popularity was classified as not popular.
We found that @nestjs-shopify/fastify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.