framer-api 0.0.1-alpha.5 → 0.0.1-alpha.7
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 +19 -2
- package/dist/index.d.ts +409 -98
- package/dist/index.js +12 -13
- package/package.json +10 -11
package/README.md
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
## Usage
|
|
2
2
|
|
|
3
|
+
### Getting your API Keys from Framer
|
|
4
|
+
|
|
5
|
+
1. Open your project in Framer, open the settings page (cmd+K or ctrl+K, type "open settings")
|
|
6
|
+
2. Find the "API Keys" section
|
|
7
|
+
3. Create a new API Key
|
|
8
|
+
4. Copy the API Key, safe it in a safe place like your password manager
|
|
9
|
+
|
|
10
|
+
### Using the API
|
|
11
|
+
|
|
3
12
|
```typescript
|
|
4
13
|
import { connect } from "framer-api";
|
|
5
14
|
|
|
6
|
-
const
|
|
15
|
+
const projectUrl = "https://framer.com/projects/Website--aabbccdd1122";
|
|
16
|
+
const apiKey = process.env.FRAMER_API_KEY ?? "api-key-from-framer";
|
|
17
|
+
|
|
18
|
+
const framer = await connect(projectUrl, apiKey);
|
|
7
19
|
|
|
8
|
-
const projectInfo = await
|
|
20
|
+
const projectInfo = await framer.getProjectInfo();
|
|
21
|
+
|
|
22
|
+
await framer.disconnect();
|
|
9
23
|
```
|
|
10
24
|
|
|
25
|
+
Call `framer.disconnect()` when done to close the connection and allow your script to exit. Idle connections will eventually be closed by the server due to an inactivity timeout.
|
|
26
|
+
|
|
11
27
|
## Publishing
|
|
12
28
|
|
|
13
29
|
Before publishing, you need to adjust the version in `package.json` to a new alpha version, e.g. `0.0.1-alpha.1`. You're yourself responible for picking the right version. Stick to SemVer.
|
|
@@ -21,5 +37,6 @@ make publish
|
|
|
21
37
|
```
|
|
22
38
|
|
|
23
39
|
This will:
|
|
40
|
+
|
|
24
41
|
- Build the package
|
|
25
42
|
- Publish the changes
|