For synchronous data import/exchange completed in one session, create a new Space each time Flatfile is opened. This suits situations where a clean slate for every interaction is preferred.

Before you begin

Get your keys

To complete this tutorial, you'll need to retrieve your Publishable key from your development environment.

Note: The Publishable Key is safe to be used in client-side applications as it has limited access to the Flatfile API.

Follow prompts from the new command.

ng new create-flatfile-angular-embed
cd create-flatfile-angular-embed
npm i @flatfile/angular-sdk @flatfile/plugin-record-hook @flatfile/listener

Build your importer

1. Initialize Flatfile

In your app.component.ts you’ll need to pass in a minimum of the publishableKey.

2. Start your client

Now, start your front end by heading to the terminal and running the following command.

  npm run start

3. Build a workbook

Now, let’s build a Workbook inside the Space for next time.

Add your config.ts file, and place the following code in it. After you have done so, import the configuration to app.component.ts, and update spaceProps to have the value of config under workbook. This config file has the configuration settings for your workbook, so feel free to edit however necessary to meet your needs.

4. Transform Data

Next, we’ll listen for data changes and respond using an event listener.

  1. Add a src/listeners/listener.ts file with this simple recordHook.
  2. Update app.component.ts to import the listener.

Once you add this code, when a change occurs, we’ll log the entered first name and update the last name to “Rock.” You’ll immediately see this begin to work when you add or update any records. Learn more about Handling Data

5. Match your brand

By attaching a themeConfig to spaceProps, we will now override colors in your Space to match your brand. See all of the options here in the Theming Reference.

  themeConfig: {
    root: {
      primaryColor: "red",
      textColor: "white",
      logo: "https://images.ctfassets.net/hjneo4qi4goj/gL6Blz3kTPdZXWknuIDVx/7bb7c73d93b111ed542d2ed426b42fd5/flatfile.svg",
    },
  },

6. Add customizations

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 Angular example project in the Flatfile GitHub repository.