Uploads an Item to a Wikibase instance (e.g., Wikidata)
The item you want to upload to Wikidata
The options for uploading
A Promise for the item after uploading
If input or response data fails Wikidata schema validation, no authentication method is provided, or the upload fails
// Using BotPasswordAuth (recommended) const auth = new BotPasswordAuth({ username: 'MainAccount@BotName', password: 'botpassword123', userAgent: 'MyBot/1.0' }); await upload(item, { summary: 'test update', auth }); Copy
// Using BotPasswordAuth (recommended) const auth = new BotPasswordAuth({ username: 'MainAccount@BotName', password: 'botpassword123', userAgent: 'MyBot/1.0' }); await upload(item, { summary: 'test update', auth });
// Anonymous upload await upload(item, { summary: 'anonymous edit', anonymous: true, origin: 'https://my-app.example.com', userAgent: 'MyApp/1.0' }); Copy
// Anonymous upload await upload(item, { summary: 'anonymous edit', anonymous: true, origin: 'https://my-app.example.com', userAgent: 'MyApp/1.0' });
Uploads an Item to a Wikibase instance (e.g., Wikidata)