Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@theo-gillet/airtable-connect
Advanced tools
Readme
This package is used to configure the Airtable integration for your project.
npm install --save airtable-connect
Create a .env
file in the root of your project and add the following:
# If you use NodeJS or VanillaJS, you can add the following to your .env file
AIRTABLE_API_KEY=
AIRTABLE_BASE_ID=
# If you use React, you can add the following to your .env file
REACT_APP_AIRTABLE_API_KEY=
REACT_APP_AIRTABLE_BASE_ID=
Connection to Airtable
import airtableConnect from 'airtable-connect'
// If project is using React, NodeJS or VanillaJS, you can use the following to load the environment variables
const { AirtableConfig, AirtableData } = airtableConnect
const example = new AirtableData('Table Name', 'View Name (optional if you want to use the default view)')
// Else you can use the following to load the environment variables
AirtableConfig.getBase('API Key', 'Base ID')
const { AirtableData } = airtableConnect
const example = new AirtableData('Table Name', 'View Name (optional if you want to use the default view)')
Retrieving Data
// Retrieve all records
example.read() // return dataset
You can also add function
in parameter of read function to get the data like this:
let data = []
example.read((dataset) => {
data = dataset
})
Creating Data
// Create a record
example.create({ 'Field Name': 'Field Value' }) // return dataset
You can also add function
in parameter of create function to get the data like this:
let newRecord = []
example.create({ 'Field Name': 'Field Value' }, (record) => {
newRecord = record
})
Updating Data
// Update a record
example.update({'id': 'ExampleID', 'fields': {'FieldName': 'Field Value'}}) // return dataset
// Update multiple records
const records = [
{
'id': 'ExampleID',
'fields': {'FieldName': 'Field Value'}
},
{
'id': 'ExampleID',
'fields': {'FieldName': 'Field Value'}
}
]
example.update(records) // return dataset
You can also add function
in parameter of update function to get the data like this:
let updatedRecord = []
example.update({'id': 'ExampleID', 'fields': {'FieldName': 'Field Value'}}, (record) => {
updatedRecord = record
})
Deleting Data
// Delete a record
example.delete('ExampleID') // return deleted data
You can also add function
in parameter of delete function to get the deleted data like this:
let deletedRecord = []
example.delete('ExampleID', (record) => {
deletedRecord = record
})
FAQs
A simple way to manage your Airtable connection
We found that @theo-gillet/airtable-connect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.