Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react sign in with linkedin

import React, { useState } from 'react';

import { useLinkedIn } from 'react-linkedin-login-oauth2';
// You can use provided image shipped by this package or using your own
import linkedin from 'react-linkedin-login-oauth2';

function LinkedInPage() {
  const { linkedInLogin } = useLinkedIn({
    clientId: '86vhj2q7ukf83q',
    redirectUri: `${window.location.origin}/linkedin`, // for Next.js, you can use `${typeof window === 'object' && window.location.origin}/linkedin`
    onSuccess: (code) => {
      console.log(code);
    },
    onError: (error) => {
      console.log(error);
    },
  });

  return (
    <img
      onClick={linkedInLogin}
      src={linkedin}
      alt="Sign in with Linked In"
      style={{ maxWidth: '180px', cursor: 'pointer' }}
    />
  );
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: textarea onclick select all 
Javascript :: how to get os theme value in javascript 
Javascript :: how to enable emit on react in vs code 
Javascript :: change cwd node 
Javascript :: classic asp get json from url 
Javascript :: nan javascript 
Javascript :: js dom siblings 
Javascript :: jquery close 
Javascript :: check valid Phonenumbers 
Javascript :: setinterval in react 
Javascript :: all redux packages 
Javascript :: ngfor only x item 
Javascript :: How to find unique values from an array in sorted order js 
Javascript :: how to code javascript 
Javascript :: discord.js remove embed from message 
Javascript :: get all child element of class javascript 
Javascript :: js stop submit 
Javascript :: how to add a letter to a string javascript 
Javascript :: empty check on django json field 
Javascript :: Uncaught (in promise) DOMException: Failed to load because no supported source was found. 
Javascript :: async await in javascript 
Javascript :: new line in rdlc expression 
Javascript :: hackerearth javascript solutions 
Javascript :: how to make bootstrap navbar to change on scroll 
Javascript :: javascript string to array 
Javascript :: nodejs write to log file 
Javascript :: find max number in java 
Javascript :: import leaflet js 
Javascript :: kubernetes taint master node 
Javascript :: mongoose find get nested prop only 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =