easy-fm supports multiple login styles. Chosen style changes how sessions behave.
const database = host.database({
database: "Contacts",
credentials: {
method: "filemaker",
username: "api-user",
password: "secret"
},
externalSources: []
})
Behavior:
DatabaseSessionPoolsessionPoolSize or library defaultUse this when:
const database = host.database({
database: "Contacts",
credentials: {
method: "token",
token: process.env.FILEMAKER_TOKEN!
},
externalSources: []
})
Behavior:
const database = host.database({
database: "Contacts",
credentials: {
method: "oauth",
oauth: {
requestId: "...",
requestIdentifier: "..."
}
},
externalSources: []
})
Behavior:
const database = host.database({
database: "Contacts",
credentials: {
method: "claris",
claris: {
fmid: "..."
}
},
externalSources: []
})
Behavior:
externalSources only works with filemaker login mode.
If you pass external sources with other auth methods, library throws.
Call close() when app shuts down or work finishes:
await database.close()
Also available:
await database.logout()
Why this matters:
For filemaker credentials:
credentials: {
method: "filemaker",
username: "api-user",
password: "secret",
sessionPoolSize: 4
}
Increase when:
Keep lower when:
If pooled request gets HTTP 401, pool retries with fresh session.
Practical meaning: