Deployment Platforms
Vercel
Add LPM_TOKEN as an environment variable in your Vercel project:
- Go to your project on vercel.com
- Navigate to Settings > Environment Variables
- Add
LPM_TOKENwith your auth token - Redeploy
Vercel runs npm install during builds, which will use the token to authenticate with the LPM registry.
If your project does not have an .npmrc file, add one to your repository root:
@lpm.dev:registry=https://lpm.dev/api/registry
//lpm.dev/api/registry/:_authToken=${LPM_TOKEN}
Netlify
Add LPM_TOKEN as an environment variable:
- Go to your site on app.netlify.com
- Navigate to Site configuration > Environment variables
- Add
LPM_TOKENwith your auth token - Trigger a new deploy
Add an .npmrc file to your repository if you do not have one:
@lpm.dev:registry=https://lpm.dev/api/registry
//lpm.dev/api/registry/:_authToken=${LPM_TOKEN}
Docker
Use a multi-stage build to keep your token out of the final image:
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json .npmrc ./
ARG LPM_TOKEN
RUN echo "//lpm.dev/api/registry/:_authToken=${LPM_TOKEN}" >> .npmrc
RUN npm install
RUN rm .npmrc
COPY . .
RUN npm run build
# Production stage
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app .
CMD ["node", "server.js"]
Build with the token as a build argument:
docker build --build-arg LPM_TOKEN=your-token -t myapp .
The token is only available during the build stage and is not included in the final image.
General Pattern
Any platform that runs npm install during builds can use LPM packages. The requirements are:
- An
.npmrcfile with the@lpm.devregistry configured - The
LPM_TOKENenvironment variable set with a valid auth token
If the platform supports a pre-install script, you can also run lpm setup instead of maintaining an .npmrc file manually.