Reuse an existing Space
Reuse a Space when Flatfile is opened.
For applications meant to use the same space consistently, open an existing space each time Flatfile is opened. This suits situations where consistently editing a dataset is preferred.
Before you begin
If you have already tried our Embed a New Space guide you will notice this guide departs heavily, so you will want to create this in a new directory, as translation would be more difficult than creating from scratch.
Get your keys
To complete this tutorial, you'll need to retrieve your Secret
key from your development
environment.
Note: Unlike the Publishable Key, the Secret Key shouldn’t be passed through the browser as it will have full access. This is why we are showing this example in a server-side call.
Follow prompts from the new
command.
Install Packages
1. Set up Configuration Files
This app has some configuration files that must be set up before you can get started with development. Set them up as shown below.
You will also want to add some scripts to your package.json
to start the app. Add the following scripts:
2. Create the Server
Lets create the server that will act as the backend of the application. This will be necessary to serve the pages as well as get the existing space, as due to security reasons the Secret Key cannot be exposed to the browser at any time. You’ll want to replace the token value with your secret key or api token.
3. Build your existing Space Component
The component should end up looking something like this:
You’ll need to update your app.component.html
to include the existing space component. It should end up looking like the below:
6. Start your client
Now you should be able to start your app. To load it in dev mode and ensure everything works proprly, run:
If you have any errors, now is your time to fix them up, else you’re ready to deploy!
7. Customize
You can stop here or you can view our full reference to see all the ways you can customize your importer.
Example Project
Find this Vue.js example project in the Flatfile GitHub repository.