Bot Password authentication provider Uses MediaWiki Action API login with bot passwords
Creates a new BotPasswordAuth instance
Bot password configuration
const botAuth = new BotPasswordAuth({ username: 'MainAccount@BotName', password: 'botpassword123', userAgent: 'MyIWFBot/1.0 (https://example.com/my-bot-info)' }); Copy
const botAuth = new BotPasswordAuth({ username: 'MainAccount@BotName', password: 'botpassword123', userAgent: 'MyIWFBot/1.0 (https://example.com/my-bot-info)' });
Clears cached login state and tokens, forcing re-login on next request
botAuth.clearCache(); Copy
botAuth.clearCache();
Ensures the user is logged in to the specified site
The site URL
Resolves when logged in
await botAuth.ensureLoggedIn('https://en.wikipedia.org'); Copy
await botAuth.ensureLoggedIn('https://en.wikipedia.org');
Gets the axios instance (for use in upload operations)
The axios instance
const axiosInstance = botAuth.getAxiosInstance(); Copy
const axiosInstance = botAuth.getAxiosInstance();
Get a CSRF token for the specified site
The CSRF token
const csrfToken = await botAuth.getCsrfToken('https://en.wikipedia.org'); Copy
const csrfToken = await botAuth.getCsrfToken('https://en.wikipedia.org');
Gets the user agent string
The user agent
const userAgent = botAuth.getUserAgent(); Copy
const userAgent = botAuth.getUserAgent();
Bot Password authentication provider Uses MediaWiki Action API login with bot passwords