Installation
SpartanFX is published to a private Azure Artifacts feed. Point the @spartanfx scope at the feed, authenticate, then install.
- Windows
- macOS / Linux / CI
1. Add .npmrc to your project root
registry=https://registry.npmjs.org/
@spartanfx:registry=https://pkgs.dev.azure.com/ProgeSwissProducts/_packaging/SpartanFX/npm/registry/
always-auth=true
2. Authenticate
vsts-npm-auth -config .npmrc
info
If you don't have it yet: npm install -g vsts-npm-auth
3. Install
npm install @spartanfx/react
1. Add .npmrc to your project root
registry=https://registry.npmjs.org/
@spartanfx:registry=https://pkgs.dev.azure.com/ProgeSwissProducts/_packaging/SpartanFX/npm/registry/
always-auth=true
2. Add a Personal Access Token
Generate a PAT with Packaging (read) scope, Base64-encode it, and add the auth lines to your user ~/.npmrc:
; begin auth token
//pkgs.dev.azure.com/ProgeSwissProducts/_packaging/SpartanFX/npm/registry/:username=ProgeSwissProducts
//pkgs.dev.azure.com/ProgeSwissProducts/_packaging/SpartanFX/npm/registry/:_password=[BASE64_ENCODED_PAT]
//pkgs.dev.azure.com/ProgeSwissProducts/_packaging/SpartanFX/npm/registry/:email=npm@requires.email
; end auth token
To Base64-encode the PAT:
node -e "process.stdout.write(Buffer.from(process.argv[1]).toString('base64'))" "YOUR_PAT"
3. Install
npm install @spartanfx/react
Peer dependencies
SpartanFX declares React and the Microsoft/Fluent stack as peer dependencies so it shares a single copy with your host app. At minimum you need:
npm install react@^17 react-dom@^17 @fluentui/react@^8
The /spfx entry additionally expects @pnp/sp, @pnp/graph, and @microsoft/sp-webpart-base (already present in an SPFx project). See Architecture for which peers each entry point needs.
Next
Continue to the Quick Start to render your first component.