Implementation example and documentation for alg ES256

I am migrating JWT in nodejs app from HS256 to ES256 and didn’t find much details about the API call and implementation details. Can someone provide documentation about API and implementation details or point to a direction for it? I am looking for the information about the following:

  1. Is ES256 good enough?

  2. private/public key can be generated with ssh-keygen, shall I choose 2048bit when generating key pair?

  3. Here is sample key I found on the website:

    “keys”: [{
    “kty”: “EC”,
    “d”: “l8JrXagEZUbRd908vDnTjKPdYPrr3V8ZQ8EtzieUxt8”,
    “crv”: “P-256”,
    “x”: “6PzW5LsKpsgbq568WqKmQ6bthPknDBZG7SinCv-Ic44”,
    “y”: “Ac3ZZAhAr8z0Bl_6C2pNh7Vg6Tc3OfeYsdIefBTClH8”

How to get the “d”, “x” and “y” in key above?
4. API call for generating token with private key and verification with private or public key.

Many thanks!