Class: IgFlare
The ergonomic entry point. Wraps the low-level engine and groups the endpoints by domain (ig.user.*, ig.friendship.*, ig.feed.*, ig.media.*). Persistence is pluggable: pass any SessionStore (memory, file, or a provider adapter) as store. The transport retries transient failures by default.
Constructors
Constructor
new IgFlare(options?): IgFlare;Parameters
| Parameter | Type |
|---|---|
options? | IgFlareOptions |
Returns
IgFlare
Properties
| Property | Modifier | Type |
|---|---|---|
account | readonly | AccountApi |
collection | readonly | CollectionApi |
direct | readonly | DirectApi |
explore | readonly | ExploreApi |
feed | readonly | FeedApi |
friendship | readonly | FriendshipApi |
hashtag | readonly | HashtagApi |
highlight | readonly | HighlightApi |
insights | readonly | InsightsApi |
location | readonly | LocationApi |
media | readonly | MediaApi |
notes | readonly | NotesApi |
reels | readonly | ReelsApi |
search | readonly | SearchApi |
story | readonly | StoryApi |
upload | readonly | UploadApi |
user | readonly | UserApi |
Accessors
client
Get Signature
get client(): PrivateClient;The underlying engine, for requests the facade does not yet wrap.
Returns
session
Get Signature
get session(): SessionData;The current session (device, auth, location).
Returns
Methods
login()
login(credentials): Promise<PrivateResponseJson>;Logs in with username and password through the CAA/Bloks flow. If the account asks for a second factor, pass twoFactor (a code, a TOTP secret, or a function that provides one) and the login resolves it. Without it a CaaTwoFactorRequiredError is thrown, to finish with resolveTwoFactor.
Parameters
| Parameter | Type |
|---|---|
credentials | IgFlareLogin |
Returns
Promise<PrivateResponseJson>
resolveTwoFactor()
resolveTwoFactor(error, code): Promise<PrivateResponseJson>;Finishes a login that stopped at the two-factor step by submitting the code.
Parameters
| Parameter | Type |
|---|---|
error | CaaTwoFactorRequiredError |
code | string | TwoFactorSource |
Returns
Promise<PrivateResponseJson>
fromStore()
static fromStore(store, options?): Promise<IgFlare>;Builds a client from a saved session in the given store.
Parameters
| Parameter | Type |
|---|---|
store | SessionStore |
options? | Omit<IgFlareOptions, "store" | "session"> |
Returns
Promise<IgFlare>