@opys/bifrost 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @opys/bifrost
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@opys/bifrost)
|
|
4
|
+
|
|
5
|
+
Mint a [Bifrost](https://gitlab.com/harmoniya/bifrost)-compatible JWT
|
|
6
|
+
locally so opys's `runClient` can launch Minecraft against a
|
|
7
|
+
self-hosted Yggdrasil server without going through the OAuth `/token`
|
|
8
|
+
flow. Signed with Ed25519 (alg `EdDSA`).
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @opys/bifrost
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
import { defineConfig, userDataDir } from '@opys/dev';
|
|
16
|
+
import { minecraft } from '@opys/minecraft-vanilla';
|
|
17
|
+
import { resolveBifrost } from '@opys/bifrost';
|
|
18
|
+
|
|
19
|
+
export default defineConfig({
|
|
20
|
+
output: 'opys.json',
|
|
21
|
+
plugins: [minecraft('1.20.1')],
|
|
22
|
+
manifest: {
|
|
23
|
+
/* … */
|
|
24
|
+
},
|
|
25
|
+
// runClient runs every launch on the launch machine — the right
|
|
26
|
+
// place for machine-local paths and a freshly-minted auth token.
|
|
27
|
+
runClient: (manifest) => {
|
|
28
|
+
const auth = resolveBifrost({
|
|
29
|
+
privateKey: process.env.BIFROST_PRIVATE_KEY,
|
|
30
|
+
username: 'deitylamb',
|
|
31
|
+
uuid: '00000000-0000-0000-0000-000000000000',
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
vars: {
|
|
35
|
+
...manifest.vars,
|
|
36
|
+
root: userDataDir('my-pack'),
|
|
37
|
+
auth_player_name: auth.username,
|
|
38
|
+
auth_uuid: auth.uuid,
|
|
39
|
+
auth_access_token: auth.token,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Pure helper — no plugin factory. Pair it with
|
|
47
|
+
[`@opys/authliberty`](https://www.npmjs.com/package/@opys/authliberty)
|
|
48
|
+
to wire the `-javaagent` that points Minecraft at your Bifrost server.
|
|
49
|
+
|
|
50
|
+
Part of the [opys](https://github.com/harmoniya-net/opys) toolkit;
|
|
51
|
+
re-exported by [`@opys/minecraft`](https://www.npmjs.com/package/@opys/minecraft).
|