import Facebook from 'bookface';
import type { Authentication } from 'bookface';
// Initialize the client
const facebook = new Facebook();
const auth: Authentication = { };
// Login (unnecessary but good to have)
await facebook.login(auth)
.then(({ credentials, scope }) => {
console.log(credentials);
console.log(scope);
});
// Publish a post to your page
const post = await facebook.page.posts.publish({
message: "Hello World!",
media: "./image.png"
});
// Read your page posts
const posts = await facebook.page.posts.read();