Design your desired gradient-style. Generate JavaScript-code. Feed your Canvas-tag.
iTo assert that the generated code will lead to exactly the same color gradient as designed in GradientLab it is necessary, that you provide the exact dimensions of the Canvas element to whom the code will be applied to.