stacks-socials

Implement OAuth2 social authentication for GitHub, Google, Facebook, and Twitter in Stacks apps.

622|17|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/stacksjs/stacks --skill stacks-socials
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-socials
Source: https://github.com/stacksjs/stacks/tree/main/.claude/skills/stacks-socials
Command: npx skills add https://github.com/stacksjs/stacks --skill stacks-socials

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Integrates robust OAuth2 social authentication across GitHub, Google, Facebook, and Twitter for Stacks apps, handling provider flows, PKCE when needed, and consistent user mapping.

Core Features & Use Cases

  • AbstractProvider base with per-provider drivers (GitHub, Google, Facebook, Twitter) and PKCE support for Twitter.
  • Generates authorization URLs, exchanges tokens, and fetches/normalizes user profiles to a unified SocialUser shape.
  • Reads credentials and default scopes from config.services, supports scope management, state, and token handling across providers.

Quick Start

Configure an OAuth2 login flow by instantiating a provider, calling getAuthUrl to start the flow, then exchange the code with getAccessToken and finally retrieve the user with getUserByToken.

Frequently Asked Questions about stacks-socials

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add OAuth2 social login to a Stacks app?

Add OAuth2 social login by instantiating a provider, calling getAuthUrl to start the flow, exchanging the code with getAccessToken, and retrieving the user with getUserByToken. This handles GitHub, Google, Facebook, and Twitter authentication.

What is the best way to handle GitHub, Google, Facebook, and Twitter authentication in Stacks?

Handle GitHub, Google, Facebook, and Twitter authentication using an AbstractProvider base class with per-provider drivers. It normalizes user profiles into a unified SocialUser shape while managing tokens and provider-specific flows.

Does Stacks social login support PKCE and state management for Twitter?

Yes, Stacks social login supports PKCE for Twitter along with standard state management. The implementation reads credentials from config.services and handles scope management across all supported providers.

Can I use social sign-in for both web and server Stacks applications?

Yes, you can use social sign-in for both web and server Stacks applications. The implementation applies to any Stacks app needing OAuth2 social authentication, user profile normalization, and token handling.

How are user profiles normalized across different OAuth2 providers?

User profiles are normalized across different OAuth2 providers by fetching raw provider data and mapping it to a unified SocialUser shape. The returned SocialUser object includes the original raw provider data alongside the normalized fields.

Where do I configure OAuth2 credentials and scopes for social authentication?

Configure OAuth2 credentials and default scopes in the config.services file. The provider drivers read these credentials and scope settings directly from this configuration to generate authorization URLs and exchange tokens.